no such file to load -- rack/openid
I am working on a rails gem which depends on rack/openid. But when I require it and fire up my application I get this error
no such file to load -- rack/openid
The gem is installed
$ gem list | grep openid
rack-openid (1开发者_如何学C.3.1, 1.2.0)
ruby-openid (2.1.8)
I've seen this question but it did NOT helped a lot.
Problem with require rack/openid in Rails 3 [native require work properly]
PS: I can require it from Irb just fine
It looks like you haven't added your Gem to the Gemfile
, or you haven't added rack-openid
as a dependency to your gem.
When Rails starts up, it uses bundler to set up the load path to match the Gemfile.lock
file, so even a gem is installed locally you won't be able to require it if it isn't listed there.
Gemfile.lock
is created by bundler based on the gems listed in Gemfile
and their dependencies.
Make sure the gem you're working on specifies rack-openid
as a dependency in its .gemspec
, and then add gem 'my-gem-name'
to your applications Gemfile
(replace my-gem-name
with whatever your gem is actually named).
精彩评论