Skip to content

Instantly share code, notes, and snippets.

@tomoyukiinoue
Created October 14, 2012 04:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomoyukiinoue/3887261 to your computer and use it in GitHub Desktop.
Save tomoyukiinoue/3887261 to your computer and use it in GitHub Desktop.
Install Rails 3.2.8 for Mac OS X Mountain Lion (10.8.2)
1. Install Xcode 4.5.1 from AppStore.
1. Install Command Line Tools via Xcode preferences.
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ brew doctor
Your system is raring to brew.
$ brew install rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
$ source ~/.bash_profile
$ brew install ruby-build
$ rbenv install -l
Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
...
1.9.3-p0
1.9.3-p125
1.9.3-p194
1.9.3-preview1
$ rbenv install 1.9.3-p194
$ rbenv versions
1.9.3p194
$ rbenv global 1.9.3-p194
$ rbenv rehash
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.0]
$ which ruby
/Users/inoue/.rbenv/shims/ruby
$ gem install rails
$ source ~/.bash_profile
$ rails -v
Rails 3.2.8
$ rails new helloworld
$ cd helloworld/
$ rails s
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-10-14 12:51:43] INFO WEBrick 1.3.1
[2012-10-14 12:51:43] INFO ruby 1.9.3 (2012-04-20) [x86_64-darwin12.2.0]
[2012-10-14 12:51:43] INFO WEBrick::HTTPServer#start: pid=28949 port=3000
@Soulkey
Copy link

Soulkey commented Jul 7, 2013

It didn't happen for me, still 1.8.7. Thank you though.

@dferdian
Copy link

@Soulkey, executing:

eval "$(rbenv init -)"

after this step:

rbenv global 1.9.3-p194

is working for me, see here for details https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x

@dferdian
Copy link

add it to bash profile to make it persist

$ echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile
$ source ~/.bash_profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment