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:inmerge_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:ineach’
/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:inload_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:inload_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:inlookup’
/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:intranslate’
/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:inhome’
/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:inperform_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:inperform_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:inms’
/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:inms’
/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:inperform_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:insend’
/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:inprocess’
/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:incall’
/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:indispatch’
/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:ininitialize’
/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:incall’
/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:incall’
/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:incall’
/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:incache’
/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:incall’
/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:incall’
/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:incall’
/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:incall’
/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:incall’
/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:ineach’
/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:incall’
/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:incall’
/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:inprocess_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:inprocess_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:ininitialize’
/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:inrun’
/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:innew’
/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:inrun’
/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:inrequire’
script/server:3

Hi –

On Wed, 1 Sep 2010, Mitchell G. wrote:

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


David A. Black, Senior Developer, Cyrus Innovation Inc.

The Ruby training with Black/Brown/McAnally
Compleat Philadelphia, PA, October 1-2, 2010
Rubyist http://www.compleatrubyist.com

Mitchell G. 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,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Sep 1, 11:01 am, Mitchell G. [email protected] wrote:

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