Project

General

Profile

undefined method `[]' for :engines:Symbol

Added by Lobo tuerto about 16 years ago

Hi guys, I'm getting this error message when trying to do the migration:
undefined method `[]' for :engines:Symbol

Any word of advice?


Replies (10)

RE: undefined method `[]' for :engines:Symbol - Added by Eric Davis about 16 years ago

Can you provide the full stack trace of the error and your Redmine environment?

Eric

RE: undefined method `[]' for :engines:Symbol - Added by Lobo tuerto about 16 years ago

For the environment I'm using Ruby Enterprise Edition 1.8.6 20080810, I have Rails 2.2.2 and 2.0.2 (using 2.0.2 in RAILS_GEM_VERSION). Ubuntu 8.10 Server. MySQL Ver 14.12 Distrib 5.0.67.

Here is the stack trace:

servidor@servidor:~/src/redmine$ 
/opt/ruby-enterprise-1.8.6-20080810/bin/rake db:migrate 
RAILS_ENV="production" --trace
(in /home/servidor/src/redmine)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `[]' for :engines:Symbol
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1016:in 
`build'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1301:in 
`add_route'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1309:in 
`add_named_route'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1098:in 
`method_missing'
/home/servidor/src/redmine/config/routes.rb:11
/home/servidor/src/redmine/config/routes.rb:10:in `each'
/home/servidor/src/redmine/config/routes.rb:10
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1250:in 
`draw'
/home/servidor/src/redmine/config/routes.rb:1
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in 
`load'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in 
`load'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in 
`new_constants_in'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in 
`load'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1293:in 
`load_routes!'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1273:in 
`load!'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1288:in 
`reload'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:293:in 
`initialize_routing'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:111:in 
`process'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in 
`send'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in 
`run'
/home/servidor/src/redmine/config/environment.rb:20
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`gem_original_require'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`require'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in 
`require'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in 
`new_constants_in'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in 
`require'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/misc.rake:3
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in 
`call'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in 
`execute'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in 
`each'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in 
`execute'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in 
`invoke_with_call_chain'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/1.8/monitor.rb:242:in 
`synchronize'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in 
`invoke_with_call_chain'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in 
`invoke_prerequisites'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in 
`each'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in 
`invoke_prerequisites'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in 
`invoke_with_call_chain'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/1.8/monitor.rb:242:in 
`synchronize'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in 
`invoke_with_call_chain'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in 
`invoke'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in 
`invoke_task'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in 
`top_level'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in 
`each'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in 
`top_level'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in 
`standard_exception_handling'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in 
`top_level'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in 
`run'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in 
`standard_exception_handling'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in 
`run'
/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/opt/ruby-enterprise-1.8.6-20080810/bin/rake:19:in `load'
/opt/ruby-enterprise-1.8.6-20080810/bin/rake:19

RE: undefined method `[]' for :engines:Symbol - Added by Lobo tuerto about 16 years ago

Hmmm seems like you can't edit your own posts.

Forgot to mention that I'm using mongrel 1.1.5.

RE: undefined method `[]' for :engines:Symbol - Added by Jean-Baptiste Barth about 16 years ago

Which version of Redmine please ?

RE: undefined method `[]' for :engines:Symbol - Added by Jean-Baptiste Barth about 16 years ago

Ok. Do you have specific plugins installed ? Or a specific version of Engines ? You should also compare your routes.rb file to see if this is the same as in trunk

I just had a look at my engines version and I can't find where engines calls "[]" on plugin.name. Perhaps here at line 69 ? Maybe you should inspect "Rails.plugins" in your routes.rb, just adding a "puts" line, and see if a plugin has a strange name.

Sorry for not having a direct solution.

RE: undefined method `[]' for :engines:Symbol - Added by Roger Pack about 16 years ago

just got this on mine [using substruct]...

adding any
config.gem 'x'

to environment.rb

results in:

C:\dev\bridal>rake gems:install --trace
(in C:/dev/bridal)
  • Invoke gems:install (first_time)
  • Invoke gems:base (first_time)
  • Execute gems:base
  • Invoke environment (first_time)
  • Execute environment
    rake aborted!
    undefined method `[]' for :substruct:Symbol
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/builder.rb:169:in `build'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:261:in `add_route'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:269:in `add_named_route'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:55:in `method_missing'
    C:/dev/bridal/config/routes.rb:47
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:207:in `draw'
    C:/dev/bridal/config/routes.rb:1
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:253:in `load_routes!'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:233:in `load!'
    C:/dev/bridal/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:248:in `reload'
    C:/dev/bridal/config/../vendor/rails/railties/lib/initializer.rb:409:in `initialize_routing'
    C:/dev/bridal/config/../vendor/rails/railties/lib/initializer.rb:154:in `process'
    C:/dev/bridal/config/../vendor/rails/railties/lib/initializer.rb:93:in `send'
    C:/dev/bridal/config/../vendor/rails/railties/lib/initializer.rb:93:in `run'
    C:/dev/bridal/config/environment.rb:21
    c:/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    c:/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in'
    C:/dev/bridal/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require'
    C:/dev/bridal/vendor/rails/railties/lib/tasks/misc.rake:3
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
    C:/dev/bridal/vendor/rails/railties/lib/tasks/gems.rake:15
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
    c:/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
    c:/Ruby18/bin/rake:19:in `load'
    c:/Ruby18/bin/rake:19

Sorry I'm not sure which version of engines--2.1?

gem v 1.3.1

RE: undefined method `[]' for :engines:Symbol - Added by Lobo tuerto about 16 years ago

Well, this was done on a clean install of Ubuntu 8.10 server.
No other plugins installed.

RE: undefined method `[]' for :engines:Symbol - Added by Lobo tuerto about 16 years ago

Everything works at it should with latest revision 2115 and Rails 2.1.2.

    (1-10/10)