undefined method `inject' for true:TrueClass

I just updated my Rubygems and rails2.3.2.

Everything was working prior to this update. Now I am getting this
error:

undefined method `inject' for true:TrueClass

I don't have the faintest idea why and I certainly don't know what the
'inject' method is or where it is called etc. Nor do I know what the
TrueClass is.

Can anyone please help.

The full trace is below:

/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:206:in
`deep_symbolize_keys'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:197:in
`merge_translations'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:177:in
`load_file'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:177:in
`each'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:177:in
`load_file'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in
`load_translations'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in
`each'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:13:in
`load_translations'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:85:in
`init_translations'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:100:in
`lookup'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:33:in
`translate'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:165:in
`translate'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/translation.rb:4:in
`t'
/Users/mitch/railsprojects/gould_development/app/controllers/public_controller.rb:7:in
`home'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:1322:in
`send'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:1322:in
`perform_action_without_filters'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:617:in
`call_filters'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610:in
`perform_action_without_benchmark'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in
`ms'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:10:in
`realtime'
/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in
`ms'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:160:in
`perform_action_without_flash'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/flash.rb:141:in
`perform_action'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in
`send'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in
`process_without_filters'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606:in
`process'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:391:in
`process'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:386:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:433:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:88:in
`dispatch'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in
`_call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in
`initialize'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/session/abstract_store.rb:122:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
`cache'
/Users/mitch/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in
`cache'
/Users/mitch/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`synchronize'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:46:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in
`each'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/content_length.rb:13:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/chunked.rb:15:in
`call'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:61:in
`process'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in
`process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
`each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in
`process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in
`run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in
`run'
/Users/mitch/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb:34:in
`run'
/Users/mitch/.gem/ruby/1.8/gems/rails-2.3.2/lib/commands/server.rb:111
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3

Hi --

I just updated my Rubygems and rails2.3.2.

Everything was working prior to this update. Now I am getting this
error:

undefined method `inject' for true:TrueClass

I don't have the faintest idea why and I certainly don't know what the
'inject' method is or where it is called etc. Nor do I know what the
TrueClass is.

Can anyone please help.

http://www.manning.black2 :slight_smile:

The full trace is below:

/Users/mitch/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:206:in

That's where inject is being called.

/Users/mitch/railsprojects/gould_development/app/controllers/public_controller.rb:7:in
`home'

What does that method look like?

David

Mitchell Gould wrote:

I just updated my Rubygems and rails2.3.2.

Everything was working prior to this update. Now I am getting this
error:

undefined method `inject' for true:TrueClass

I don't have the faintest idea why and I certainly don't know what the
'inject' method is or where it is called etc. Nor do I know what the
TrueClass is.

Looking at the Ruby core and standard library documentation would answer
both those questions for you.

Can anyone please help.

The full trace is below:

[...]

David already gave you some guidance on how to read the stack trace;
looks like Rails is calling inject on an object for which it's not
defined. Good luck! Let us know if you have further questions...

Best,

At a guess rails doesn't like some of your translation data - i'd look
very carefully at any of the translation data used by line 7 of your
public controller. TrueClass is the class that true is an (in fact
the only) instance of.

Fred