Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Ruby / Ruby on Rails 3 Beta Setup Hurdle

Ruby on Rails 3 Beta Setup Hurdle

February 9, 2010 by Rob Bazinet 8 Comments

Tweet

The Ruby on Rails 3 beta was released recently and has been in development for the past year, longer if you take into account Merb.

I decided I wanted to start playing around with the release for a few reasons:

  • In order to see what issues developers may face moving to Rails 3 with existing applications.
  • I wanted to see the new architecture changes from Rails 2.x
  • I also wanted to see first-hand creating a simple application and all that is involved.

There are plenty of tutorials about how to setup Rails 3 and I won’t go into details here but wanted to share the method I used and one particular error I received and how I resolved it. Jeremy McAnally has some great coverage of using Rails 3, both new projects and upgrades. His rails_upgrade gem is a great place to start when beginning to look at moving an existing Rails project to Rails 3.

Setup

I decided to use the awesome Ruby Version Manager (RVM) to manage testing Rails 3 on different flavors of Ruby. The first thing to know is Rails 3 requires Ruby 1.8.7 and above, so no 1.8.6.

Ryan Bates has a great intro to setting up Rails 3 with RVM in his latest Railscast titled Rails 3 Beta and RVM.

I decided to use Ruby 1.8.7 for initial testing. There are a bunch of gem dependencies when working with Rails 3, as you might expect. There is a gem called rails3b which installs the necessary dependencies in one swoop. These two command should do the trick:

gem install rails3b
gem install arel --pre

After these commands finished and I closed and reopened my terminal prompt, a quick rails command gave me the following error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:261:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:68:in `gem'
from /usr/local/bin/rails:18

Some Googling did not return any usable results from anyone with this error. I really didn’t expect anything, things are just too new. Thinking back to another way to install Rails 3, I decided to try this instead:

gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
gem install rails --pre

After running these two gem commands the new rails command works as expected. I’m not really clear what the difference was which fixed the rails command, but I don’t know if I need to.

Do keep in mind the default database provider is Sqlite3 so you need to install that gem (sqlite3-ruby). Probably one of the biggest tips is to make sure you don’t use sudo when installing gems under RVM managed Ruby installation, just use gem install <gem name>.

UPDATE: Jeremy McAnally points out the rails3b gem installs the dependencies for the Rails 3 beta, not Rails itself.  This would certainly explain why my initial attempt failed and only worked after INSTALLING RAILS.

Technorati Tags: Rails 3,Ruby

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Ruby

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Recent Posts

  • Social Media Times Are Changing
  • It has certainly been a long time…
  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Great little utility https://t.co/6AgboJv6oI
    about 1 day ago
  • Funny watching the hate to show up in my time line for ChatGPT. People getting defensive about it.
    about 4 days ago
  • I just backed The SaaS Playbook, by Rob Walling on @Kickstarter https://t.co/1FpTWN9c9v
    about 5 days ago
  • This looks like an interesting project. I need to dig in a bit. https://t.co/gacEX9AmEn "Phlex — fast, object-orie… https://t.co/4AUL0Z0SBl
    about 5 days ago
  • I attempted to use ChatGPT today and asked a couple questions it couldn’t answer. I thought it was a magical black… https://t.co/uJGw0CgUAv
    about 5 days ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon