Getting Rails 3 Beta Setup
If you use Ruby on Rails, you’ve probably heard by now about the release of the Rails 3.0 betayesterday. There’s been a lot leading up to this release, so naturally most of the rails world is eager to jump in and give it a try. Saturday morning is a great time to get started, so I decided to give it a try.
First off, I wanted to make sure I had a more up to date version of Ruby. Rails 3.0 beta and up will require Ruby 1.8.7 or higher. If you’re running Snow Leopard you probably already have this, but can always do a ruby -v to check your current Ruby version. The easiest way I’ve found to run multiple versions of ruby is using the rvm gem. It handles everything needed for running multiple versions of Ruby, including Rubygems. Just install the gem and go from there:
link:~ adam$ sudo gem install rvm link:~ adam$ rvm-install link:~ adam$ mate ~/.bash_profile link:~ adam$ ruby -v link:~ adam$ rvm install 1.9.1 link:~ adam$ rvm use 1.9.1 link:~ adam$ sudo gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n link:~ adam$ sudo gem install rails --pre
At this point, I tried to create a new rails project using the usual rails [projectname], but I ended up getting the following error:
link:research adam$ rails beta /Library/Ruby/Site/1.8/rubygems.rb:384:in `bin_path': can't find executable rails for rails-3.0.0.beta (Gem::Exception) from /usr/bin/rails:19
A lucky comment in another blog showed a fix for this:
sudo gem install railties --pre
After that I was able to create a project the usual way, and start messing around the latest version of Rails. Looking forward to upgrading some existing sites!
link:research adam$ rails testsite link:research adam$ cd testsite link:testsite adam$ rails server

when using rvm and installing gems you are not supposed to use sudo. sudo should only be used for system rails.
I think you need to run the command “bundle install” before you can run the “rails server” command.