Class in lib/ not loading (RoR)

software development



I have an app with a customized redcloth class, which I load via the lib folder (#{RAILS_ROOT}/lib/customredcloth.rb). This works on several other environments (including my localhost version of this site), but I cannot get it to work on my dreamhost setup.

If I comment out my CustomRedCloth call, everything works, but without this particular functionality which is necessary for the client.

The require in my environment.rb does break if I change the case/spelling, so it seems as if that is finding the file. However, when I visist the page using my CustomRedCloth, I get:

[color=#0000CC]ActionView::TemplateError (uninitialized constant CustomRedCloth) on line #8 of sections/show.rhtml: 8: <%= %> [/color]This happens regardless of using fcgi or passenger (I’m currently running with passenger).

Any ideas?


Did you restart your web site / application?

Changes to classes aren’t picked up unless the Rails process is restarted when in production mode.


Yeah, I tried that, but no luck.

I already changed hosting providers and got things working straight away, but thanks for your post! :slight_smile: