Install Ruby on Rails
August 12, 2012
Recently I started learning ruby on rails. And unlike other languages everything happens mostly in terminal, so next thing I know - I have to use command line now. I tried few tutorials here and there but couldn't find anything that explained how to properly install ruby and rails step by step, something for ruby beginners. So, I wrote my process here. I'm using mac and ruby 1.8.7 is pre-installed with Mac OS 10.6 Snow Leopard or later. Xcode has to be installed.
- First check ruby version, maybe you're lucky and there is latest one already installed
- Update whatever is installed
sudo gem update --system
sudo gen install railsthis installs rails and all necessary libraries if you see error "Failed to build gem native extension", make sure "commnad line Tools" are inastalled in Xcode (xcode preferences -> downloads -> components).
gem listand rails should be listed there
rails -vchecks what version of rails is installed
- To upgrade ruby to latest version I used RVM (ruby version manager), to install RVM use
curl -L https://get.rvm.io | bash -s stable
- restart terminal and load rvm by typing
user$ source ~/.rvm/scripts/rvm
- check if rvm is running
source ~/.rvm/scripts/rvmif you see rvm is a function, everything is working so far.
- list all possible installation
rvm list known
- see what version you'd like to install (in my case it was 1.9.3)
- install the new version
rvm install 1.9.3, codess q to continue
- finally switch to newly installed version
rvm install 1.9.3and check
ruby -vif you see ruby 1.9.3 - it's all set and you can start using / learning ruby on rails with everything up to date.