Ruby on Rails
SettingYourPath

The Ruby 1.8 installer for Mac OS X often leaves Ruby 1.6 the default. A lot of Mac users who are looking to play with Rails get bitten by this.

If typing ruby -v in Terminal.app tells you ‘ruby 1.6.8’ then you are having this problem. (Assuming you’ve installed Ruby 1.8—see GettingStartedWithRails)

Assuming you use the bash shell, the easiest method to correct this is as follows:

  1. Open a brand, spanking new Terminal.app window
  2. echo $SHELL must read ”/bin/bash”
  3. echo "" >> ~/.bash_profile
  4. echo "export PATH=/usr/local/bin:\$PATH" >> ~/.bash_profile
  5. chmod +x ~/.bash_profile
  6. Close Terminal window and open a new one
  7. Type ‘ruby -v’ to ensure you now have 1.8.2 working

For csh or tcsh:

  1. Open a brand, spanking new Terminal.app window
  2. echo $SHELL must read ”/bin/csh” or ”/bin/tcsh”
  3. echo "" >> ~/.login
  4. echo "setenv PATH /usr/local/bin:\$PATH" >> ~/.login
  5. chmod +x ~/.login
  6. Close Terminal window and open a new one
  7. Type ‘ruby -v’ to ensure you now have 1.8.2 working

If you get into trouble, stop by the #rubyonrails irc channel.