开发者

Rails is not recognizing an installed gem

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 开发者_C百科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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜