Installing Rails 3 on Ubuntu 10.10



Installing Ruby on Rails using Ubuntu’s native package manager certainly has its advantages — namely keeping the packages up to date for you — but currently, this will get you older versions of Ruby and Rails.  Ruby 1.8.7 and Rails 2.3.5 are fine, but Rails 3 has many improvements and new Ruby developers should probably start with this version.

Get the latest version of Ruby here:

http://www.ruby-lang.org/en/downloads/

tar zxvf ruby-<version>.tar.gz
cd ruby-<version>
./configure
sudo make && make install

To avoid a “no such file to load: zlib” error later, get ruby-zlib here:

http://raa.ruby-lang.org/project/ruby-zlib

tar zxvf ruby-zlib-<version>.tar.gz
cd ruby-zlib-<version>/
sudo ruby extconf.rb
sudo make && make install

Download and install RubyGems here:

http://rubyforge.org/frs/?group_id=126

tar zxvf rubygems-<version>.tgz
cd rubygems-<version>/
sudo ruby setup.rb

Then install Rails 3 with RubyGems:

sudo gem install rails

Use apt-get to install ‘sqlite3′ and ‘libsqlite3-ruby-<most-recent-version>’, and then:

bundle install

… will install ‘sqlite3-ruby’ for you.

That’s it!  Decide on a directory where you want to do your development and then:

rails new testsite

Jump into your new ‘testsite’ directory and try to start the server:

rails server

This entry was posted in Linux, Ruby on Rails. Bookmark the permalink.

One Response to Installing Rails 3 on Ubuntu 10.10

  1. Hugo says:

    Thanks, this is the only way I could get Ruby 1.9.2 and Rails 3 installed on Ubuntu. For some reason I always have issues trying to do it with RVM.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">