Skip to content

Instantly share code, notes, and snippets.

@adamjmurray
Created May 13, 2010 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamjmurray/400132 to your computer and use it in GitHub Desktop.
Save adamjmurray/400132 to your computer and use it in GitHub Desktop.
Setting up Rails 3 on OS X (as of May 13, 2010)

Getting setup with Rails 3 right now can be tricky because of bugs that manifest with various combinations of ruby and rails versions. The best thing to do right now is to get the bleeding edge version of everything. Using the following process you can do that without impacting your existing ruby / rails installation.

UPDATE: As of July 2, 2010 it looks like you don't have to grab Ruby 1.9.2-head any more. Release Candidate 1 (RC1) of 1.9.2 was released and it worked fine during my brief testing. You can get it @ http://www.ruby-lang.org/en/news/2010/07/02/ruby-1-9-2-rc1-is-released/ or install with rvm (see below)

Install rvm

rvm is the 'ruby version manager' for easily managing multiple versions of ruby. If you don't have it already, run:

 bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

and then add this line to .bash_profile:

 if [[ -s "$HOME/.rvm/scripts/rvm" ]]  ; then source "$HOME/.rvm/scripts/rvm" ; fi

init rvm by opening a new terminal window (or source .bash_profile)

Install Ruby 1.9.2

UPDATE: If you just install and use 1.9.2, it will install 1.9.2-RC1 which seems to work fine. So you can omit all the '-head' in the below commands.

The latest dev version is 'head':

 rvm install 1.9.2-head

Then you either need to run this each time you open a new terminal window where you want to run rails 3:

 rvm use 1.9.2-head

Or make 1.9.2 your default ruby (potentially dangerous!) with:

 rvm --default 1.9.2-head

See rvm docs for more info.

Install Rails 3 and create a rails app

Get the prerelease version of rails 3

 gem install rails --pre 

And create your app

 rails new app_name

Then I had to install sql lite before I could start the server:

 gem install sqlite3-ruby 

OLD INSTRUCTIONS (last time I tried I had to do this instead) Create a new app with the edge version of rails (this will vendor the absolutely latest version of Rails, which is newer than the prerelease installed by the gem).

 rails app_name --edge

The step 'run bundle install from "."' will take a long time, it's not frozen it's just installing the edge version of rails.

Getting started with Rails 3

http://omgbloglol.com/post/371893012/the-path-to-rails-3-greenfielding-new-apps-with-the

http://guides.rails.info/3_0_release_notes.html

http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/

Pragmatic Programmers has a beta version of Rails 4th edition, covering Rails 3: http://pragprog.com/titles/rails4/agile-web-development-with-rails

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