Strange problem with JRoR, plugins and environment

Hi

I have a rails project where I have Globalize2, state_machine and some
other plugins in use. When trying to run migration scripts with JRuby
1.1.6 and RAILS_ENV=test or production I get a following error message:

A copy of Globalize::Model::ActiveRecord::Translated::ActMethods has
been removed from the module tree but is still active!

Script causing the error is:
class CreateUnits < ActiveRecord::Migration
def self.up
create_table :units do |t|
t.timestamps
end
Unit.create_translation_table! :name => :string, :abbreviation
=> :string
end

def self.down
drop_table :units
Unit.drop_translation_table!
end
end

With RAILS_ENV=development migration goes ok.
MRI works ok, with all environments, JRuby 1.1.5 works with all
environments, JRuby trunk from a week ago failed.
If I change config.cache_classes to false, then the test and
production environmets works.
If state_machine plugin is disabled, it works.

Some dummy project where I used similiar model and migration, worked
also with 1.1.6.
On the other machine the migrations worked with 1.1.6. I copied the
jruby directory from that machine and it failed on my machine.

Anyone have ideas whats wrong or how to debug more?

Thanks.

– Miika


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Miika Leppänen wrote:

Hi

I have a rails project where I have Globalize2, state_machine and some
other plugins in use. When trying to run migration scripts with JRuby
1.1.6 and RAILS_ENV=test or production I get a following error message:

Nothing about the script sets off any alarms for me…

With RAILS_ENV=development migration goes ok.
MRI works ok, with all environments, JRuby 1.1.5 works with all
environments, JRuby trunk from a week ago failed.
If I change config.cache_classes to false, then the test and production
environmets works.
If state_machine plugin is disabled, it works.

One thing that changed in 1.1.6 was better constant caching…perhaps
it’s possible we’re holding something that we should not be or not
flushing a cache appropriately?

Some dummy project where I used similiar model and migration, worked
also with 1.1.6.
On the other machine the migrations worked with 1.1.6. I copied the
jruby directory from that machine and it failed on my machine.

Anyone have ideas whats wrong or how to debug more?

I don’t know enough about the error…can you ask around (Rails guys
maybe) what it means and how we can investigate? Or if anyone else on
the list has seen that before, do you know what it means?

The only thing I remember about this error is that it can happen when
Rails is set up to reload classes when they change, but after reloading
it sees an old class still being used (somehow). This code is pretty
wild, and I don’t totally understand it…so I think we need to enlist
some help from Rails experts.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email