Recently I had a bit of trouble getting {{ “github.com/aanand/git-up” | ext_link: “git-up”}} to work on Ubuntu (or anywhere else for that matter), so here’s some of the steps I had to go through.

Initially ubuntu seems to have RubyGems 1.01 and 1.2.0 installed :

> gem --version
1.2.0
>/usr/bin/gem1.8 --version
1.2.0
>/usr/bin/gem1.9 --version
1.0.1

Unlike installation on OS X the initial gem install worked fine :

> sudo gem install git-up
Successfully installed git-up-0.1.0
1 gem installed
Installing ri documentation for git-up-0.1.0...
Installing RDoc documentation for git-up-0.1.0...

Trying to actually use it, however, caused a few errors :

>  git up
/usr/local/lib/site_ruby/1.8/rubygems.rb:578:in `report_activate_error': Could not find RubyGem thoughtbot-shoulda (>= 0) (Gem::LoadError)
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:134:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:158:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:157:in `each'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:157:in `activate'
        from /usr/local/lib/site_ruby/1.8/rubygems.rb:49:in `gem'
        from /usr/bin/git-up:18

This error persists even after installing shoulda :

>  sudo gem install shoulda
Successfully installed shoulda-2.10.3
1 gem installed
Installing ri documentation for shoulda-2.10.3...
Installing RDoc documentation for shoulda-2.10.3...

After my experience installing it on OS X, i decided the easiest way to move forward was probably to install RubyGems 1.3.1 :

> wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
> tar xzf rubygems-1.3.1.tgz
> cd rubygems-1.3.1
> sudo ruby setup.rb
.....
RubyGems installed the following executables:
        /usr/bin/gem1.8

If `gem` was installed by a previous RubyGems installation, you may need
to remove it by hand.

> gem -v
1.3.1
> sudo gem install git-up
Successfully installed git-up-0.1.0
1 gem installed
Installing ri documentation for git-up-0.1.0...
Installing RDoc documentation for git-up-0.1.0...

After this, trying to run git up caused a bunch of missing dependency errors, and I had to install gems for archive-tar-minitar, nokogiri (which also required installing libxslt-ruby), and rcov. Finally, I got stuck trying to install hoe :

> sudo gem install hoe                                                                                                                         1 ?
ERROR:  Error installing hoe:
        gemcutter requires RubyGems version >= 1.3.5

Let’s try all this again with RubyGems 1.3.5 :

> wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
> tar xvzf rubygems-1.3.5.tgz
> cd rubygems-1.3.5
> sudo ruby setup.rb
RubyGems installed the following executables:
        /usr/bin/gem1.8
> gem -v
1.3.5
> sudo gem -v
1.3.5
> sudo gem install git-up
Successfully installed git-up-0.1.0
1 gem installed
Installing ri documentation for git-up-0.1.0...
Installing RDoc documentation for git-up-0.1.0...
> git up
master              up to date

Finally with RubyGems 1.3.5, git-up works fine, with no dependency issues or missing gems.