views:

311

answers:

5

I have a clean install of Ubuntu 9.10. I want to install Ruby 1.8, RubyGems and Rails. The install usually fails when trying to get or update RubyGems. Sorry for the lack of details, I have gotten stuck on a number of fronts.

What is the best, guaranteed to work, installation guide\blog post\tutorial for installing Ruby, RubyGems and Rails on Ubuntu 9.10?

THANKS

+2  A: 

This Slicehost article is what I follow. Although it's for Ubuntu Hardy it should work for you.

John Topley
A: 

This will get ruby and rubygems - make sure you get the versions you want and update these commands accordingly.

apt-get update
apt-get upgrade -y

sudo apt-get install build-essential libssl-dev libreadline-dev -y

sudo apt-get install wget

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz

tar xzf ruby-1.8.7.tar.gz

cd ruby-1.8.7-p287
./configure --prefix=/usr/local

make && sudo make install


wget http://rubyforge.org/frs/download.php/43985/rubygems-1.3.4.tgz

tar xzf rubygems-1.3.4.tgz
cd rubygems-1.3.4
sudo ruby setup.rb
ruby-v
gem-v

For rails, sudo gem install rails 
Why are you suggesting building rails from src and not from apt?
jonnii
Additionally I would suggest using rvm (http://rvm.beginrescueend.com/) for managing ruby and gem versions.
jonnii
I would recommend to use Ruby Enterprise Edition which performs better if you run Rails applications and is also very easy to install.
t6d
A: 
sudo apt-get install rails

Should do it for you (and automatically install dependencies such as ruby). Currently Ruby 1.8.7 is in the repos. It can get a bit behind coming up to a new Ubuntu release, but not too far.

Macha
A: 

The Community Ubuntu Documentation is in my opinion the best guide.

It covers different type of web servers and make use of Ubuntu's apt-get where possible. Just note that it's probably still best to install RubyGems from source instead of using apt-get.

htanata
A: 

Thank you all for the help and advice.

Last night I followed this guide: http://www.hackido.com/2009/11/install-ruby-on-rails-on-ubuntu-karmic.html

I managed to install rails. I stopped following the steps after rails was installed so I cannot vouch for the rest of the tutorial, but it did help me to install Rails on Ubuntu 9.10.

Thanks

Daryn