2009
09.23

There is a known problem with ruby on Debian or Ubuntu with gem command not working properly.  Here is how to fix it.

Update: –with-openssl option don’t exist in ruby-1.8.6-p399

So here is how to install RoR from source:

user@computer:$ cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p388.tar.gz
tar -zxf ruby-1.8.6-p388.tar.gz
cd ruby-1.8.6-p388
./configure --with-openssl
make
make install
cd ..

install ruby gems

user@computer:$ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar -zxf rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb
cd ..
gem install rails

When you try to use gem command you will see something like this:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:1
….

The solution is described on lots of website on the internet:

user@computer:$ wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
tar xvzf ruby-zlib-0.6.0.tar.gz
cd ruby-zlib-0.6.0
ruby extconf.rb
make
make install

If ruby extconf.rb fails, try to install zlib1g-dev package via apt.

Finally install rails

user@computer:$ gem install rails

However I have only found one website to be refered as a source for missing lib: http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz which didn’t work when I needed this file. I thought it’s a good idea to serve this file here.

ruby-zlib-0.6.0.tar

Bookmark and Share

No Comment.

Add Your Comment