resolve/refinerycms — Issue #1092: module Crud problems with Rubinius
Author: cordawyn
Created: 2011-10-22 22:55:47+00:00
State: open

I'm running RefineryCMS (1.0.8, rails-3.0.10) with Rubinius (rbx-1.2.4-20110705). When I open a RefineryCMS page, I'm getting "TypeError (wrong argument type NilClass (expected Module))" error.
I managed to track it down to refinerycms-core-1.0.8/lib/refinery/application_controller.rb:28:

c.send :include, Crud # basic create, read, update and delete methods

Apparently, Rubinius fails to look-up "Crud" in a very peculiar way. Changing the line to use a "fully qualified" constant name fixes the problem:

c.send :include, ::Refinery::Crud # basic create, read, update and delete methods

I suspect this is also a thread-related issue, because this line works fine without the fix... only once. When I reload a successfully rendered page (and thus start another thread in Rails), the error appears.
Although the above change fixes this, the question still remains who's to be blamed here :)