Musings about Entrepreneurship, Technology and Software Development

Accidental Technologist

  • Home
  • Contact
  • About
  • Still River Software

Ruby on Rails 3 Beta Setup Hurdle

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:

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

February 9, 2010 Posted in Ruby

Micro.blog

Popular Posts

  • 10 Alternative Ruby Web Frameworks
  • 7 Resources Every JavaScript Developer Should Know
  • Setting up SQLite3 for Ruby on Rails Development
  • Running Rails 3 on Windows

Categories

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Latest Tweets

  • rbazinet
    @rbazinet
    RT @IndieHackers: If an aspiring indie hacker could only read one book on the topic, what book would you recommend? https://t.co/KfV7s2XAfe

    5 hours ago
  • rbazinet
    @rbazinet
    Not the right time to consider a MacBook Pro at this point - Best & Worst Laptop Brands 2018 https://t.co/cy55gn2SRe

    2 days ago
  • rbazinet
    @rbazinet
    @zmoazeni what do you use for an desktop UI on Arch? I’ve not really considered Linux, not sure why. I’ve tried Rai… https://t.co/Qe0ZYhNELw

    2 days ago
  • rbazinet
    @rbazinet
    @zmoazeni Would you run Windows? I’ve been looking at the Thinkpad P51, Xeon proc.

    2 days ago
  • rbazinet
    @rbazinet
    I need a new laptop, really hoping Apple has some good news about fixing the MacBook Pro at a WWDC announcement. Ho… https://t.co/A1EEp5IK4S

    2 days ago

Tags

Agile Android Apple App Store ASP.NET MVC book bootstrapping Business conference Customer Service Droid X email entrepreneurship functional programming Google InfoQ InstantRails iOS iPad iPhone JavaScript mac microconf Microsoft mixergy mobile objective-c Open Source podcast pow rails Rails3 railsconf RSS Ruby Ruby on Rails scala sinatra Software swift twitter Windows WordPress WPEngine xcode

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2018 · Genesis Minimal Notebook on Genesis Framework · WordPress · Log in

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.