2
votes

I'm using rvm with ruby 1.9.3, rails 3.1, gems i18n and i18n-active_record and mysql. In vendor/plugins/18n-active_record/i18n-database-backend.rb I've got

module I18n
  module Backend
    class Database < ActiveRecord
    ...

Commands rails server, rails console or even rake db:version fails with error:

/vendor/plugins/i18n_database_backend/lib/i18n_database_backend.rb:3:in `<module:Backend>': wrong argument type Module (expected Class) (TypeError)

It looks like application is trying to use ActiveRecord module instead of I18n::Backend::ActiveRecord (http://rubydoc.info/docs/rails/2.3.8/I18n/Backend/ActiveRecord) . What can be the reason of this behavior? Gem i18n is installed of course, and command bundle install was executed.

1

1 Answers

2
votes

Try to explicitly require the class in your code above your module definition like this:

require 'i18n/backend/active_record'

And make sure you have the i18n-active_record gem in your Gemfile.