Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.6.10 undefined local variable or method `translations' #259

Closed
tmcgilchrist opened this issue May 29, 2014 · 6 comments · Fixed by #260
Closed

0.6.10 undefined local variable or method `translations' #259

tmcgilchrist opened this issue May 29, 2014 · 6 comments · Fixed by #260

Comments

@tmcgilchrist
Copy link

Updating to 0.6.10 seems to have broken something.

/Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n/backend/fallbacks.rb:43:in `block in translate': undefined local variable or method `translations' for #<I18n::Backend::Chain:0x007ff65aacce18> (NameError)
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n/backend/fallbacks.rb:42:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n/backend/fallbacks.rb:42:in `translate'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n.rb:157:in `block in translate'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n.rb:153:in `catch'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/i18n-0.6.10/lib/i18n.rb:153:in `translate'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/i18n/translator.rb:8:in `translate'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/i18n.rb:79:in `translate'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/login.rb:65:in `validates_format_of_login_field_options'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/login.rb:134:in `block in included'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/login.rb:131:in `class_eval'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/login.rb:131:in `included'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/base.rb:41:in `include'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/base.rb:41:in `block in acts_as_authentic'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/base.rb:41:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/authlogic-abc09970ed1f/lib/authlogic/acts_as_authentic/base.rb:41:in `acts_as_authentic'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/blake-shared-f54a50d3e8be/app/models/student.rb:50:in `<class:Student>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/blake-shared-f54a50d3e8be/app/models/student.rb:33:in `<top (required)>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:330:in `require_or_load'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:463:in `load_missing_constant'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:184:in `const_missing'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:495:in `load_missing_constant'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:184:in `const_missing'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/blake-shared-f54a50d3e8be/app/mailers/base_notifier.rb:7:in `<class:BaseNotifier>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/bundler/gems/blake-shared-f54a50d3e8be/app/mailers/base_notifier.rb:3:in `<top (required)>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `block in require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:330:in `require_or_load'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:289:in `depend_on'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:207:in `require_dependency'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:464:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:464:in `block in eager_load!'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:462:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:462:in `eager_load!'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/engine.rb:347:in `eager_load!'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/application/finisher.rb:56:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `run'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/tim/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/application.rb:215:in `initialize!'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/railties-4.0.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/tim/Blake/readingeggs/config/environment.rb:5:in `<top (required)>'
    from /Users/tim/Blake/readingeggs/spec/spec_helper.rb:18:in `require'
    from /Users/tim/Blake/readingeggs/spec/spec_helper.rb:18:in `<top (required)>'
    from /Users/tim/Blake/readingeggs/spec/features/adwords_tracking_spec.rb:1:in `require'
    from /Users/tim/Blake/readingeggs/spec/features/adwords_tracking_spec.rb:1:in `<top (required)>'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `each'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load_spec_files'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run'
    from /Users/tim/.rvm/gems/ruby-2.1.1@readingeggs/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `block in autorun'

Please let me know if you need more details.

@carlosantoniodasilva
Copy link
Member

Commits d100659 and 12aa0f0 seem to be the cause, related issues are #238 and #258.

I'll try to look into it soon, thanks for reporting.

@arthurnn
Copy link
Contributor

@carlosantoniodasilva looking into this too..

@L1quid
Copy link

L1quid commented May 29, 2014

I have this problem as well. Reverted to 0.6.9 and it's working again.

@carlosantoniodasilva
Copy link
Member

I've just yanked the 0.6.10 version from rubygems while we figure out a fix or revert the offending commit. Meanwhile please revert back to 0.6.9. Thanks.

arthurnn added a commit to arthurnn/i18n that referenced this issue May 29, 2014
Commit 12aa0f0 introduced a bug, where
if `Fallbacks` module is included in a class that doesnt define
`translations` the code would fail. This is a pretty common
scenario, for instance when the backend is a `Chain`. Also this was
pretty common case to fail in rails, as its include Fallbacks in the
I18n.backend, like this:
```
I18n.backend.class.send(:include, I18n::Backend::Fallbacks)
```

This stops using the `translations` method in the fallbacks, and instead
ignores `I18n::InvalidLocale` errors.

[fixes ruby-i18n#238]
[fixes ruby-i18n#258]
[fixes ruby-i18n#259]
@carlosantoniodasilva
Copy link
Member

Can you guys try with current master and let us know whether it's working or you are still having issues? Thanks.

@carlosantoniodasilva
Copy link
Member

0.6.11 has been released which should fix this issue, please let me know if anything goes wrong. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants