follow me icons

Saturday, November 13, 2010

Installing Gem Bundler in Ubuntu 10/Mac 10.6

Bundler is a ruby gem to manage your application dependencies. Previously I have to install all of my required gems one by one. This is very tedious and error prone when you have alot of gems to install. Also, with bundler you can install the gems into your local project directory so that your project will not use the system gem which might have a different version than what your project uses.

You would need to install ruby in Ubuntu 10


sudo apt-get install build-essential
sudo apt-get install ruby rdoc libopenssl-ruby


The next step is to install the gem bundler. Gem bundler requires us to install RubyGems version > 1.3.6 and this is where I have problem installing it in Ubuntu 10.04

I encounter a few issue in installing gem bundler in Ubuntu 10.04. Ubuntu asks me to install RubyGems using 'apt-get install Rubygems1.9.1'. Then I run the:


gem install bundler
ERROR: Error installing bundler:
bundler requires RubyGems version >= 1.3.6


And I get the bundler requires RubyGems version error. I found out that I have to install the bundler manually using ruby setup.
This steps have been tested in both Ubuntu and Mac OS X 10.6.6

1. Download the rubygems directly from rubygems.org
2. Unpack the files (tar zxvf rubygems-1.3.7.tgz)
3. cd rubygems-1.3.7
4. ruby setup.rb
5. gem install bundler


root@ubuntu:/home/rubygems-1.3.7# gem install bundler
Successfully installed bundler-1.0.3
1 gem installed

5 comments:

  1. Thanks worked great. Just make sure to sudo each step of the way.

    ReplyDelete
  2. Eek, that seems to have broken my system wrt ruby. The Ubuntu/Debian system expects the gems to live in /var/lib/gems, but that rubygems installs things into /usr/lib/ruby/gems. I fixed (hopefully) the problem by symlinking the latter to the former.

    ReplyDelete