Rails 3.0.0.rc // rails locales prevent app boot

Hi all,

I got the following error message when booting up my app (which works fine with Rails 3.0.0.beta4) in Rails 3.0.0.rc;

activesupport-3.0.0.rc/lib/active_support/file_update_checker.rb:27:in `stat': can't convert Array into String (TypeError)

When I put some debug code on that line I see the follwing array being passed;

["/Users/smath/.rvm/gems/ruby-1.8.7-p299/gems/activesupport-3.0.0.rc/ lib/active_support/locale/en.yml", "/Users/smath/.rvm/gems/ruby-1.8.7- p299/gems/activemodel-3.0.0.rc/lib/active_model/locale/en.yml", "/ Users/smath/.rvm/gems/ruby-1.8.7-p299/gems/activerecord-3.0.0.rc/lib/ active_record/locale/en.yml", "/Users/smath/.rvm/gems/ruby-1.8.7-p299/ gems/actionpack-3.0.0.rc/lib/action_view/locale/en.yml", ["/werkmap/ projects/skylight/twizzi2/config/locales/en.yml", "/werkmap/projects/ skylight/twizzi2/config/locales/fr.yml", "/werkmap/projects/skylight/ twizzi2/config/locales/nl.yml"], "/werkmap/projects/skylight/twizzi2/ config/locales/en.yml", "/werkmap/projects/skylight/twizzi2/config/ locales/fr.yml", "/werkmap/projects/skylight/twizzi2/config/locales/ nl.yml"]

If you look good, you see that my locales files (in the middle of the main array) are in a new array.

This middle-array is being passed into File.stat which can't handle arrays. So when I change line 25 in file_update_checker from;

      paths.map { |path| File.stat(path).mtime }.max

to

      paths.flatten.uniq.map { |path| File.stat(path).mtime }.max

All seems to work fine, however I don't know wheter that's a good fix or not.

I'm currently using rvm with ruby-1.8.7-p299.

Can someone verify this problem before I turn it into a ticket?

Thanks!

Stijn

Ok, just some more info...

I tried to do the same with a clean app and that gave no problems. So I start disabling features in my current app untill I didn't get the error. It turns out that the i18n_routing plugin causes the problem. It translate the current routes into various locales and seems to call that method before the paths are flatten out.

Still not sure wether this is a plugin or a core issue. Please advise.

Thanks,

Stijn

If it’s the plugin doing it then it’s the plugin’s fault.

No?

Yes, I guess so.

I digged a little deeper in the plugin and it seems that the additional array is appended in the plugin code. I already notified the plugin developer.

So I guess it's case closed for Rails :slight_smile:

Thanks anyway.

Stijn