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
.
精彩评论