# I18n error with Rails 2.2.2

**URL:** <https://www.ruby-forum.com/t/i18n-error-with-rails-2-2-2/160237>\
**Category:** Rails I18n\
**Created:** [February 13, 2009, 10:24am UTC](https://www.ruby-forum.com/t/i18n-error-with-rails-2-2-2/160237 "2009-02-13T10:24:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [February 13, 2009, 10:24am UTC](https://www.ruby-forum.com/t/i18n-error-with-rails-2-2-2/160237/1 "2009-02-13T10:24:34Z")

</div>

hi,  
I’m using i18n with Rails 2.2.2 to internationalize my rails  
application.  
I’ve followed the steps as specified at:

> **[Railsrocket.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=railsrocket.com)**
>
> Easy, affordable options for you to obtain the domain you want. Safe and secure shopping.

But …I get the following error when I try to run it:  
You have a nil object when you didn’t expect it!  
You might have expected an instance of Array.  
The error occurred while evaluating nil.inject  
1:  
2:

## \<%= I18n.t :hello\_world %\>
  
3:   
  
4: 
## \<%= I18n.t :hello\_everyone %\>
  
5:  
RAILS\_ROOT: E:/i18n  
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:208:in  
`deep_symbolize_keys' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:199:in `merge\_translations’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in  
`load_file' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in `each’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in  
`load_file' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in `load\_translations’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in  
`each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in `load\_translations’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:79:in  
`init_translations' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:94:in `lookup’  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:33:in  
`translate' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n.rb:160:in `t’  
app/views/main/index.rhtml:2

Can anyone please tell me…how can I correct this…  
Thank You…

---

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [March 18, 2009, 8:48pm UTC](https://www.ruby-forum.com/t/i18n-error-with-rails-2-2-2/160237/2 "2009-03-18T20:48:36Z")

</div>

hi i’have got same problem and adjusting en.yml have fixed it. the my  
issue was:

en:

means empty localization file, i have changed it to:

en:  
foo:

and now it seems it works…

Jeba M. wrote:

> hi,  
> I’m using i18n with Rails 2.2.2 to internationalize my rails  
> application.  
> I’ve followed the steps as specified at:  
> [Railsrocket.com is for sale | HugeDomains](http://www.railsrocket.com/articles/wp-content/uploads/i18n-your-rails-app-in-34-languages.pdf)
> 
> But …I get the following error when I try to run it:  
> You have a nil object when you didn’t expect it!  
> You might have expected an instance of Array.  
> The error occurred while evaluating nil.inject  
> 1:  
> 2:
> 
> ## \<%= I18n.t :hello\_world %\>
>   
> 3:   
>   
> 4: 
> ## \<%= I18n.t :hello\_everyone %\>
>   
> 5:  
> RAILS\_ROOT: E:/i18n  
> Application Trace | Framework Trace | Full Trace
> 
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:208:in  
> `deep_symbolize_keys' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:199:in `merge\_translations’  
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in  
> `load_file' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in `each’  
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:179:in  
> `load_file' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in `load\_translations’  
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in  
> `each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in `load\_translations’  
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:79:in  
> `init_translations' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:94:in `lookup’  
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active\_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:33:in  
> `translate' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n.rb:160:in `t’  
> app/views/main/index.rhtml:2
> 
> Can anyone please tell me…how can I correct this…  
> Thank You…
