Posted by Vince Wadhwani on Aug 17, 2007

I was recently following my own instructions for installing Rails on Feisty when I ran into a problem. The mongrel cluster refused to run on Ruby 1.8.5. When I wrote my initial HowTo we were using Ruby 1.8.5 and mongrel cluster 0.2.1. Now we're up to version 1.0.2 of the mongrel cluster but Feisty is still on Ruby 1.8.5. A bug has been filed for a backport but that won't help you today..

I tried grabbing an old version of Mongrel Cluster but unfortunately couldn't find it. Plus, it's almost always better to favor a 1.0.x release over a 0.2.x release so let's get Ruby 1.8.6 installed and see if that solves our problems.

There's a great HowTo that was written for Edgy which we're going to follow exactly. There's no reason you shouldn't go over to his blog and follow the instructions there. I'm only posting them here in case his server goes down at some point. So here they are:

1. Go to http://www.ruby-lang.org/en
2. Download ruby-1.8.6.tar.bz2
3. tar xjvf ruby-1.8.6.tar.bz2
4. cd ruby-1.8.6
5. apt-get build-dep ruby1.8
6. ./configure --prefix=/usr
7. make
8. sudo make install

I will strongly recommend rebooting after running step 8. Then check your version by typing ruby -v. You should get output that looks like this:

ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux]

If you were following the install rails on feisty how to, you would do this in between step 3 and 4.

Update: Oct 24 If you previously had a working rails install and you follow the above directions you'll find lots of stuff stopped working. To fix things you need to complete a few other steps:

  1. Download rubygems again from Rubyforge.
  2. Uncompress the file (using zip or tar xvzf), cd into the uncompressed directory, and run ruby setup.rb
  3. cd into your ruby architecture's directory and copy the thread.so file into /usr/ lib/ruby/1.8.

For #3 above, you could issue this command for AMD-64: (slicehost)

# sudo cp usr/lib/ruby/1.8/x86_64-linux/thread.so /usr/lib/ruby/1.8/

or for certain intel machines

# sudo cp usr/lib/ruby/1.8/i686/thread.so /usr/lib/ruby/1.8/

Thanks to Errol, Jean Nibee and Diego Alban for doing the heavy lifting on this!

Finally, you may also need to reinstall certain gems such as Mongrel and rake in order to get your system humming again. If you see an error like this you know that you've got a situation where you need to reinstall a a gem:

/usr/lib/ruby/1.8/x86_64-linux/rbconfig.rb:7: ruby lib version (1.8.6)
doesn't match executable version (1.8.5) (RuntimeError)
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
        from /usr/bin/rake:9:in `require'
        from /usr/bin/rake:9