1) Install XCode from App Store

#### 2) Install Command Line Tools from terminal

xcode-select --install

3) Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

And make sure everything is correctly configured

brew doctor

If you get an warning like this

Warning: A newer Command Line Tools release is available

Update them from Software Update in the App Store.

Warning: You have not agreed to the Xcode license.
Builds will fail! Agree to the license by opening Xcode.app or running:
xcodebuild -license

Install XCode Command Line Tools

Open XCode, agree the license, close and run again

brew doctor

4) Install RVM

\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm

Be sure “rvm is a function”

type rvm | head -n 1

5) Install RVM requirements

brew update
rvm requirements

If you get an error something like: No available formula for apple-gcc42 and cannot continue installing, run this code:

brew install autoconf automake libtool pkg-config apple-gcc42 libyaml readline libxml2 libxslt libksba openssl sqlite


rvm requirements

6) Make sure you install RVM:

rvm -v
rvm 1.24.4 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

7) Install Ruby

rvm get head
rvm install 2.0.0-p247

Make sure you installed Ruby

ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]

8) Use final version

rvm use 2.0.0-p247 --default

9) Install RubyGems

rvm rubygems current

10) Install Rails

gem install rails

Make sure you installed Rails

rails -v
Rails 4.0.0

When you want to backup your application database on heroku, you can use “PG Backups” add-on.

heroku pgbackups

and you will see old saved database.

Select last one, example: b004

heroku pgbackups:url b004

and you will get an url, copy it

curl -o latest.dump "PASTE URL HERE"

you downloaded your dump.

and this code will restore your database (change ‘MYUSER’ and ‘MYDB’):

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U MYUSER -d MYDB latest.dump

And you restored your postgresql local database.

Other installations just say that download the Sublime Text 2 and run it, but this installation is like installing usual programs via terminal.

#### How to Install Sublime Text 2 on Ubuntu:

1) Add sublime-text-2 PPA to your system

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update

2) If there is any Sublime Text 2, uninstall it.

sudo apt-get remove sublime-text*

3) And finally, install the stable version of Sublime Text 2

sudo apt-get install sublime-text

We have to install “RVM”, “Ruby”, “Gem” and “Rails” one by one.

0) Update your packages

sudo apt-get update

1) Install RVM (Ruby Version Manager)

sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm

2) Be sure “rvm is a function”

type rvm | head -n 1

3) Find requirements and Install all of them

rvm requirements

sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

4) Install Ruby

rvm install 2.0.0-p247

5) Use final version

rvm use 2.0.0-p247 --default

6) Install RubyGems

rvm rubygems current

7) Install Rails

gem install rails

And you have Ruby On Rails on you Ubuntu