views:

97

answers:

2

I am trying to install ruby-mp3info as a gem on my computer. Running sudo gem install ruby-mp3info seems to work OK. In my environment.rb file, I added config.gem "ruby-mp3info". When I try to run the server, it fails, claiming I have some missing gems Following the error message's advice:

Run `rake gems:install` to install the missing gems.

I run the command, which simply returns my local path. Running the server again - I get the same error message.

Could someone explain what I am doing wrong? How does one go about installing gems from RubyForge - or in general?

How does the gem command know where to find the necessary files - they are not all stored on my computer. Does it have hardcoded urls built into it?

+1  A: 

Here's what did the trick. In my environment.rb file, I had the following:

config.gem "ruby-mp3info"

Playing around with the options, I found that I had to specify the lib attribute:

config.gem "ruby-mp3info", :lib => "mp3info"

This solved the problem.

yuval
the irony, by the way, is that after I went through all of that I realized I had no use for the library... I am consoled by the fact that this post may save someone the two hours I spent looking for a solution...
yuval
A: 

I've run into a similar problem on servers when running Phusion Passenger (mod_rails). Problem being I forget to update the Passenger gem repository like this:

/opt/ruby-enterprise-1.8.6-20090421/bin/gem install whatever

instead of simply this:

gem install whatever

It would be a useful utility for someone to write, keeping the 2 gem repos in sync.

Midwire