views:

284

answers:

1

I tried to install the ruby-hmac gem

If I do "gem list", I see it is installed:

...
RedCloth (3.0.4)
ruby-hmac (0.3.2)
ruby-openid (1.1.4)
...

However when I try to include it in my Rails project...

config.gem "ruby-hmac"

I get an error:

Missing these required gems:
  ruby-hmac  

You're running:
  ruby 1.8.6.287 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  rubygems 1.3.4 at /Users/TAmoyal/.gem/ruby/1.8, /Library/Ruby/Gems/1.8, /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

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

So I take a look at my gems directory...

Macintosh-2:bhr TAmoyal$ ls -al /Library/Ruby/Gems/1.8/gems/
drwxr-xr-x  12 root  admin   408 Jun 28 23:14 rake-0.8.7/
drwxr-xr-x   8 root  admin   272 Dec  5 00:34 ruby-hmac-0.3.2/
drwxr-xr-x   9 root  admin   306 Jun 28 23:35 rubyforge-1.0.3/

permissions look fine so I try to include another gem from that same directory:

config.gem 'javan-whenever', :lib => false, :source => 'http://gems.github.com'

And the console loads fine. For some reason it cannot see ruby-hmac but it sees another gem that appears on gem list and is also installed in the same directory with the same permissions.

Does anyone know how to troubleshoot this? I have tried uninstalling and reinstalling.

Thanks!

+5  A: 

You might want to provide a :lib option for our config.gem like

config.gem "ruby-hmac", :lib => 'ruby_hmac'

Some gems do have a lib name that is different from the gem name. I'm not exactly sure what the lib name for the ruby-hmac gem would be. Try looking the at the docs for clues.

nowk
that was it...i didn't know the "lib" param was actually required and there was nothing in the docs about it. just took a guess based on your answer
Tony
I encountered the same error tonight with the OpenID gem; here is the "lib" value that worked in this case: config.gem "ruby-openid", :lib => "openid"
bjnord