Mongrel Cluster 1.0.2 and Ruby 1.8.5
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:
- Download rubygems again from Rubyforge.
- Uncompress the file (using zip or tar xvzf), cd into the uncompressed directory, and run ruby setup.rb
- 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
Quick question - will this mess things up if I installed ruby via apt-get? I hate do admit it, but even after using it for a long time, I’m still a bit of a Linux noob.
(Also, thanks for the nginx guide! I had to change things around a bit to access phpmyadmin via localhost but it worked out.)
Paul O'Shannessy
Hi Paul,
I first installed ruby via apt-get and then compiled version 1.8.6 on top of that and it worked fine. I’m not sure how Debian/Ubuntu will handle it when a newer version of Ruby comes out but it looks like it may be version 1.9 which may have to be installed via “apt-get install ruby1.9” in which case we’ll be fine..
vince
JeanNiBee
JeanNiBee
Hi JeanNiBee,
Not sure what the issue may be but I’m guessing something is compiled with an older version of Ruby. I hate to punt on this, but I think your best bet would be to send an email over to the Ruby Deployment list or visit the installing rails section of railsforum.com
–Vince
vince
Thanks Vince. That’s what I thought but figured I should check with somebody who’s done a bit more than me.
Paul O'Shannessy
Hi Vince,
I’m happy to know that my howto http://codersifu.blogspot.com/2007/03/howto-install-ruby-in-ubuntu-edgy-610.html help you.
deman
Hi Vince,
I’m happy to know that my howto has helped you. Hope others will find it helpful too.
deman
I had the same problem as JeanNiBee. I solved it by reinstalling mongrel:
sudo gem install mongrel
I got the idea of re-installing mongrel when I saw this during the mongrel installation:
Building native extensions. This could take a while…
I guess you should do the same for any other gem that says that during installation.
Diego Alban
after having some problems (the same as jeanibee actually, i’ve had to reinstall ubuntu and then install ruby 1.8.5 first and mongrel. of course mongrel cluster doesn’t work. i don’t want to mess everything up again and i was asking myself the question: what –prefix=/usr as to do when it’s all about to configure the source. isn’t it that who create the problem as ruby after won’t look in n the right folders?
as for nginx, i still have a an error when i try to spawn using the sample script so i spawn it through lighttpd, wich isn’t the best solution i admit. for the last version of nginx for debian/ubuntu and not the prehistoric one proposed by aptitude go there:
http://technokracy.net/nginx/
who will have the stable and the latest dev version !
cheers,
osiris
osiris
after having some problems (the same as jeanibee actually, i’ve had to reinstall ubuntu and then install ruby 1.8.5 first and mongrel. of course mongrel cluster doesn’t work. i don’t want to mess everything up again and i was asking myself the question: what –prefix=/usr as to do when it’s all about to configure the source. isn’t it that who create the problem as ruby after won’t look in n the right folders?
as for nginx, i still have a an error when i try to spawn using the sample script so i spawn it through lighttpd, wich isn’t the best solution i admit. for the last version of nginx for debian/ubuntu and not the prehistoric one proposed by aptitude go there:
http://technokracy.net/nginx/
who will have the stable and the latest dev version !
cheers,
osiris
osiris
The problem re-appeared for me when I tried to use Rake. This Google Group discussion had the solution for “thread.so (LOAD ERROR)” problem.
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/c6aa4f5429a1e890/c36ef83a56ac32be?lnk=raot
The solution is at the bottom of the page. Basically copy the thread.so file around. You might need to use sudo. After copying thread.so to the right directory I could use Rake normally.
Diego Alban
Ahmed