How to install Ruby on Rails on Mac OSX Mavericks
By: Lukasz Muzyka, On:
Installing Command Line Tools
All the below commands we will type in Terminal. To open terminal you can open search on your mac and simply type "terminal". The first search result should be the right one. Once you open it you should be welcomed by a black screen of the terminal. We are going to use it a lot.
*Note: Are you in China? make sure you have your VPN on if you want to play the videos.
Step 1: Install Line Tools
To install command line tools type:
$ xcode-select --install
This command will install tools that are necessary to set up other elements that will allow us to run Ruby on Rails on our computer. This step is very important
Step 2: Install Homebrew
Homebrew is a special program we will use to install packages on our machine.
In terminal write:
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" $ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile $ source ~/.bash_profile
Next check if everything is configured correctly:
$ brew doctor
Brew is being updated constantly so we will have to run the update
$ brew update
You should run this command every time before using brew
Step 3: Install RVM, Ruby and Rails
We will use RVM - a Ruby version manager to install Ruby and Rails. All in one go, so this may take a while. Simply run:
$ \curl -sSL https://get.rvm.io | bash -s stable --rails
Let's see if everything is properly installed by listing all versions of Ruby that we have on our machine:
$ rvm list
If you're using the latest version (at the time of writing this - it was 2.1.0) you are good to go. If not, you can run:
$ rvm use 2.1.1 --default
Or whichever is the latest.
Now, you're ready to create apps in Ruby on Rails!
You can login to comment