Installing Ruby on Rails on OS X 10.10 Yosemite

This post will help you setup Ruby on Rails for OS X 10.10 Yosemite. This setup is also compatible for older versions of OS X.

Installing Homebrew

Homebrew helps us to install and compile software packages from the source. Open your terminal and type the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Installing Ruby

Once homebrew is finished installing, we can proceed to install Ruby. For now we will be using rbenv to install and manage our ruby versions. To do the following, type the following command in your terminal:

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby 2.1.5 and set it as the default version

rbenv install 2.1.5
rbenv global 2.1.5

ruby -v
# ruby 2.1.5 

Installing Rails

Once Ruby is configured, we can start to install rails. Type the following command in your terminal:
gem install rails

rbenv rehash

rails -v
# rails 4.1.8

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Remove duplicates from a JavaScript Array

Sending Binary Data over the Network with Json