Read more

Upgrade from Ruby 1.8.7 to Ruby 1.9.2 on Ubuntu

Henning Koch
March 25, 2011Software engineer at makandra GmbH

Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if that is your setup. The rspec-rails gem has a fatal bug Show archive.org snapshot that was only fixed for rspec-rails-2.x, which only supports Rails 3. There is no fix for the rspec-rails-1.3.x series of the gem which supports Rails 2.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Anyway, here are upgrade instructions if you only work with Rails 3 or don't use RSpec. You will lose all your gems in the process, but you can get them back easily if you have been using Bundler.

sudo apt-get uninstall ruby1.8 ruby
sudo apt-get install ruby1.9.1 ruby1.9.1-dev # this is actually Ruby 1.9.2
sudo ln -s /usr/bin/ruby1.9.1 /usr/bin/ruby
# Now download RubyGems from https://rubygems.org/pages/download
tar xvzf rubygems-1.x.x.tgz
cd rubygems-1.x.x
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.9.1 /usr/bin/gem
sudo gem install bundler

You will now need to run bundle install in your projects to get your gems back.

Posted by Henning Koch to makandra dev (2011-03-25 21:51)