Thursday, March 8, 2007

HOWTO: Ubuntu Edgy Eft (6.10) + Ruby 1.8.5 + Gem 0.9.2 + Rails 1.2.2

There have been several excellent articles / blogs / etc explaining how to get the latest version (as of 2007-03-08) of ruby + gem + rails running on Ubuntu 6.10 Edge Eft, but no one resource met my needs to get me completely up and running.

So here's the various excellent resources I used to finally get ruby + gem + rails working on my ubuntu system:

Install ruby:
http://www.rubywizards.com/viewtopic.php?pid=19

Grab the gem source
http://rubyforge.org/frs/?group_id=126&release_id=9501

To Install gem:
tar -zxvf rubygems-0.9.2.tgz
cd rubygems-0.9.2
ruby setup.rb

If you get the zlib error, you probably need to get additional libs:
apt-get install zlibc zlib1g zlib1g-dev
(see http://www.nabble.com/Gems-zlib-problem-t992896.html for more info)

Re-compile and re-install ruby now that the new libs are there
http://www.rubywizards.com/viewtopic.php?pid=19

Make sure you're running the latest version:
ruby -v
ruby 1.8.5 (2006-08-25) [i686-linux]

if you still get the zlib error, copy the zlib over (this should be one line):
sudo cp /usr/lib/ruby/1.8/i486-linux
/zlib.so /usr/local/lib/ruby/site_ruby/1.8/i686-linux/

Great info about the zlib error in Ubuntu:
http://www.penlug.org/twiki/bin/view/Main/LinuxBookReviewsAgileWebDevelopmentwithRails

Then re-install gem:
ruby setup.rb

make sure gem works:
gem -v
0.9.2

Then grab rails:
gem install rails --include-dependencies --remote

make sure you're good to go:
rails -v
Rails 1.2.2


I hope this helps someone!

4 comments:

gbh said...

It might be better to actually recreate (with or without attribution) the steps that you simply linked to. The web is a volotile medium and things disapear quickly.

Anonymous said...

Indeed.

Already, some of these links don't work.

Which is a shame, as I'd definitely have found this resource useful.

cheezel said...

There is no zlibc apt package, otherwise this worked for me. You can use the instructions at kyledev.blogspot.com... to fix the zlibc problem, and also make sure to get and build readline as he instructs to have a complete rails. Thanks!

Anonymous said...

it helped indeed! thanx a lot.