views:

417

answers:

1

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'

Can anyone tell me how to fix this? TIA!

A: 

Is sunlight listed in your Gemfile? Rails3 uses Bundler to manage Gem installations.

Bryan Ash