Using Comatose With rForum

on 08.31.2006, tagged: tips n tricks. .

Several people have been reporting issues with rForum. The error messages can be a little deceiving, leading you to believe the error is in navbar.rb or a @Localization@ class.

Actually, the problem has to do with Rails' loading sequence. Plugin code is loaded before the application code. In some applications this can lead to problems.

So, you have two options for fixing the rForum problem.

Option One

Remembering that plugins are loaded alphabetically, we create a simple plugin that will load before Comatose that includes the appropriate rForum startup code.

In the console, enter:

./script/generate plugin 01_app_loader

It should spit out:

  create  vendor/plugins/01_app_loader/lib
  create  vendor/plugins/01_app_loader/tasks
  create  vendor/plugins/01_app_loader/test
  create  vendor/plugins/01_app_loader/README
  create  vendor/plugins/01_app_loader/Rakefile
  create  vendor/plugins/01_app_loader/init.rb
  create  vendor/plugins/01_app_loader/install.rb
  create  vendor/plugins/01_app_loader/lib/01_app_loader.rb
  create  vendor/plugins/01_app_loader/tasks/01_app_loader_tasks.rake
  create  vendor/plugins/01_app_loader/test/01_app_loader_test.rb

Then you open the vendor/plugins/01_app_loader/init.rb file and paste this into it:

require RAILS_ROOT + '/config/app'

That's it! It should work now, as you'd expect.

Option Two

Update the vendor/plugins/comatose/init.rb and add the same require RAILS_ROOT + '/config/app' to the very top of the file.

I don't really recommend this way, however. You'd have to redo it if you updated Comatose.


If you've already installed Comatose, you'll need to uninstall it before you create the new plugin. After you've pasted the startup code, you can re-install Comatose, generate the migration and go to town!

« Oh, And I'm Back | Main | Comatose 0.7 Released! »