Rails 3 Initializers: No such file to load

Posted by waveslider on Stack Overflow See other posts from Stack Overflow or by waveslider
Published on 2010-06-06T20:35:34Z Indexed on 2010/06/06 20:42 UTC
Read the original article Hit count: 193

Filed under:

I am trying to use the Sunlight API gem with a Rails project. I have installed the gem and can successfully use it from irb.

However, when I put the require statement (require 'sunlight') in sunlight.rb in config/initializers, I get the following error:

/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:209:in `require': no such file to load -- sunlight (LoadError)

I checked the permissions on the gems directory, and it is world readable/executable.

Here is the code from sunlight.rb:

require 'rubygems'
require 'sunlight'
Sunlight::Base.api_key = 'bb7b775755054c54aa9715d202f6785c'

© Stack Overflow or respective owner

Related posts about ruby-on-rails3