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 HomebrewHomebrew 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 RubyOnce 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 RailsOnce 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