Saturday, October 9, 2010

Installing Rails 3 in Ubuntu 10.4

For the record, and for those of my friends who are going to participate in the Rails Rumble next weekend: here's how you install Rails 3 on your Ubuntu Karmic system. (10.10, known as Maverick, is supposed to arrive tomorrow and might make this post obsolete. But I won't be risking an upgrade before the weekend.)

  1. Install Ruby; apt contains the required version:
    sudo apt-get install ruby
  2. Uninstall RubyGems, because we'll install a more recent version from source:
    sudo apt-get remove rubygems
  3. Install RubyGems from source:
    cd /tmp
    tar xzf rubygems-1.3.7.tgz
    cd rubygems-1.3.7
    sudo ruby setup.rb
    sudo ln -s gem1.8 /usr/bin/gem
  4. Install Rails:
    sudo gem install rails


philippe said...

Thank you! this was very useful!

Anonymous said...

sudo ruby setup.rb gives

rubygems.rb:1190:in `': undefined method `load_defaults' for Gem::Specification:Class (NoMethodError)
from :1:in `require'
from :1:in `'

What is wrong?

Thomas ten Cate said...

No idea. What are you still running a three-and-a-half year old Ubuntu for?