CommonThread - Our Blog

Upgrading Ruby on Ubuntu (from package to source)

Written By: Ben Wyrosdick

January 23rd, 2008

We recently updgraded from ruby 1.8.4 to 1.8.6 on our production servers. When we did we went from the package manager versions of ruby to a source install, bedlam followed. Gems that required native extensions were no longer working properly and flames were pouring from the machines. So here is a list of actions to help anyone else wanting to upgrade on an Ubuntu machine.

  1. remove all gems ( sudo gem list, gem uninstall )
  2. remove all ruby related packages ( dpkg—list | grep ruby, dpkg -r )
  3. download ruby and rubygems src
  4. extract and install ruby ( ./configure—prefix=/usr , make , sudo make install )
  5. extract and install rubygems ( sudo ruby setup.rb )
  6. install gems ( sudo gem install )

2 Responses to “Upgrading Ruby on Ubuntu (from package to source)”

  1. Falk Says:
    so how do you upgrade or uninstall your self-compiled ruby/gems?
  2. Johann Says:
    These instructions worked moving from Ubuntu Jaunty's Ruby 1.8.7 to the compiled source for Ruby 1.9.1. I got some additional support from http://blog.fiveruns.com/2008/3/3/compiling-ruby-rubygems-and-rails-on-ubuntu. I didn't use the prefix=/usr parameter of the configure command, preferring to let it default to /usr/local since I installed it and Ubuntu did not, but that's pretty much a personal choice. Thanks for putting this together.

Leave a Reply