After moving to Ubuntu 10.04 and running mongrel – he crashes with this error message:

 [BUG] gc_sweep(): unknown data type

It is a bug in Ruby code. So I’ve moved to an older release (one without this bug). How to do it?

Update repos:

sudo apt-get update
sudo apt-get dist-upgrade

Install some “must have” libraries:

sudo apt-get install libssl-dev zlib1g zlib1g-dev ruby-dev  libopenssl-ruby1.8 irb ri rdoc libopenssl-ruby

Download ruby1.8_1.8.7.174.orig.tar.gz, from tutaj or Google it ;)

After downloading run your shell and type:

cd ruby-1.8.7-p174
sudo ./configure
sudo make
sudo make install
sudo apt-get install libncurses5-dev libreadline5-dev
cd ext/readline/
ruby extconf.rb
make
sudo make install
cd ..
cd ..
cd ..
rm -R ruby-1.8.7-p174

Check Ruby version:

ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]

Install other stuff:

sudo apt-get install mysql-server  sqlite3 libmysql-ruby
sudo apt-get install build-essential  libmysqlclient-dev libmysql-ruby libsqlite3-ruby libsqlite3-dev

Rubygems:

wget  http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.zip
unzip rubygems-1.3.6.zip
cd rubygems-1.3.6
sudo ruby setup.rb
cd ..
rm -R rubygems-1.3.6
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem

Gems, gems, gems:

sudo gem install mysql sqlite3-ruby mongrel

And finally:

sudo gem install rails -v=2.3.5