开发者

rails Can not load a installed Gem

I have installed the gem : oauth2

I can load it in irb:

$ irb -rub开发者_如何学Cygems
irb(main):001:0> require 'oauth2'
=> true

I have :

require 'rubygems'

in my code

and have set RUBYOPT :

export RUBYOPT=rubygems 

while I still get the error:

LoadError in XXXController#login    
no such file to load -- oauth2

Any help will be appreciated.


Did you specify the gem as a dependency in Rails? If you are using Rails 3, make sure the gem is listed in your Gemfile and you successfully executed the command $ bundle install.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜