RubyGems with Ubuntu 8.04 in a VM Woes
Posted on: August 22, 2009
I use the fantastic virtual hosting solution Linode for my primary website. In order to launch one of my new projects using Ruby and Rails, I was required to install the RubyGems software on this site.
Unfortunately there is a problem with the version of RubyGems (<v1.01) that comes with Ubuntu, when installing in a virtual machine with limited memory. This causes any gem command to max out the cpu and hang with the output: “Bulk updating Gem source index for: http://gems.rubyforge.org”.
To solve this, we need to install the latest version of gems manually.
The first step ensure that we have all the ruby essentials installed …
sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev… but not rubygems from the Ubuntu repository.
sudo apt-get remove rubygemsNow download and install the latest version of Rubygems. The version as of this time is 1.3.5
wget http://rubyforge.org..... #replace with actual link
tar xzvf rubygems-x.x.x.tgz
cd rubygems-x.x.x
sudo ruby setup.rbI would suggest at this point you link the gem command, and update gems
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --systemSuccess! You should now be able to use gem to install our dependencies. For example, I needed rake, rails, and mongrel
sudo gem install rake
sudo gem install rails
sudo gem install mongrel