Rails

From TaxonWorks Wiki
Revision as of 19:11, 26 September 2013 by Gaurav (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installing Rails 4.0 on MacOS X

  1. Get Homebrew.
    • Homebrew installs software into /usr/local, so you might need sudo-powers to install it, but -- once installed -- all Homebrew installations shouldn't need sudo at all.
  2. brew install ruby
    • Since this will install Ruby into /usr/local, OS X's system Ruby (1.8.7) will be untouched.
    • Run ruby --version to make sure you have Ruby 2.0.
  3. Add /usr/local/Cellar/ruby/2.0.0-p0/bin to your PATH (mine is in ~/.bash_profile). You need to open a new terminal or start a new shell after this.
    • If you miss this step (like I did), running rails will call your system rails (/usr/bin/rails), which will ask you to install rails using sudo. Don't believe it.
  4. gem install rails
    • If this step works correctly, the rails binary will be installed into /usr/local/Cellar/ruby/2.0.0-p0/bin, so if that's in your path, running rails -v will report that you have rails 4.0 installed.
  5. Use which rails to make sure your path to the rails binary is correct -- it should *not* be in /usr/bin!

Related Ruby stuff