0

I'm running Ubuntu 9.10. I am getting started with ruby on rails development and would like to make sure my system is up to date.

This is what I've found out so far:

$ which ruby
/usr/bin/ruby

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

$ which gem
/usr/bin/gem

$ gem -v
1.0.1

$ which rails
/usr/bin/rails

$ rails -v
Rails 2.2.2

$ gem install sqlite3-ruby
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  could not find sqlite3-ruby locally or in a repository

Solution:

Ruby 1.8.7 is a current version. My version of RubyGems needs to be updated. So does Rails. I will need to update RubyGems before I can update Rails.

From the RubyGems User Guide:

If your RubyGems version is 0.8.5 or later, you can upgrade to the latest version with:

sudo gem update --system

If your current version of RubyGems is older than version 0.8.5, or you see the message “Nothing to update” when you tried gem update --system, then use the following commands:

sudo gem install rubygems-update
sudo update_rubygems 

Now that RubyGems is up to date, we can update Rails. To update Rails, as well as all the other gems, use the following command:

sudo gem update

To see which Gems you have installed, you can run this command:

gem list --local

To install a new Gem, or see which Gems are available to install, see this page of the RubyGems guide

3 Answers 3

3

Your ruby version is fine, 1.9 is still a little experimental and there are a number of libraries that don't work quite right with it yet.

You'll also want to upgrade ruby gems itself, and seeing as you have quite an old version you'll want to use these two commands:

sudo gem install rubygems-update
sudo update_rubygems

Which should install ruby gems version 1.3.5, then future updates can be done with:

sudo gem update --system

You can also update all installed gems with:

sudo gem update
0
1

First, you need to run gem as root user when installing new gems. Second, you need to add the -r parameter the first time you run this command to specify that you're installing from a remote repository.

$ sudo gem install sqlite3-ruby -r

Note that this gem is also available as an Ubuntu package:

$ sudo aptitude install libsqlite3-ruby

Use the former if you need (recent versions of) gems that are not available as packages.

To keep the Ubuntu packages up to date, use the Ubuntu Update Manager or whatever other method you use to keep other software up to date.

0

Install Ruby Version Manager!

Seriously! I wish I would have done this sooner. Ruby Version Manager makes it possible to run multiple versions of Ruby, each with their own set of gems, and switch between the different versions seemlessly. Plus, you won't have to use sudo anymore. Plus, it's got great documentation. Plus, it's super easy to install, so you should do it!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .