views:

384

answers:

1

I'm trying to setup this plugin (Crumble), and the docs say I need to add a configuration file for the plugin in config/initializers/ like this (breadcrumb.rb):

Breadcrumb.configure do
   ...
end

I add in my directives in that block, and reloaded the page, and I'm immediately greeted with a Passenger error:

uninitialized constant Breadcrumb

What am I missing here? gem list shows Crumble as installed, and if I launch IRB I can require 'crumble' successfully. I remember doing this just fine in Rails 2.3.5. Here's my setup:

rails 3.0.0.beta3
ruby 1.9.1p378 (via RVM)
passenger 2.2.11 (with Apache2)
crumble 0.1.2

I've been trying to read the Rails 3 release notes to see if they've changed anything that would affect this, but so far I haven't found anything to suggest that the above shouldn't work. I'd appreciate any guidance you could spare me!


UPDATE: I got it working with the plug-in, so the problem is not with Crumble. I seem to be missing something when I try to use the gem. I'm almost positive I just have something in the wrong place as of Rails 3 Beta, but I just don't know what. Thoughts?

A: 

Two questions to answer first:

1) Are you using RVM for you ruby installs and have you set passenger up to user the RVM install?

2) What user are you running passenger (via apache or nginx) as? Is it the same user you installed the gem with?

If the answer to that is all yes, do you have gem "crumble" in your Gemfile?

I found many times that this is an issue of installing the gem as one user and then passenger is using a different user to run the Rails app which in turn means that passenger's ruby has no knowledge of the gem breadcrumb.

I highly recommend using RVM for managing ruby integrating it into passenger if you are not already.

Lukas