开发者

How can I diagnose and fix this 'uninitialized constant' error?

I have a working Redmine 0.8.0 site that I'm trying to upgrade to 1.2.1 (most recent stable). I have met all listed requirements and followed their upgrade directions as far as I can, but I'm stuck at the final step before clean up - migration. Based on the evidence below, I'm guessing that part of my infrastructure (Ruby, RubyGems, or one of my gems) is not at the right version, but I can't figure out who's at fault. How can I determine the next step to fix this issue?

The upgrade directions state:

If you have installed any plugins, you should also run their database migrations. If you are upgrading from Redmine 0.8.x as part of this migration, you need to upgrade the plugin migrations first:

rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production

rake db:migrate_plugins RAILS_ENV=production

running

$sudo rake --trace db:migrate:upgrade_plugin_migrations RAILS_ENV=production

gives the following error:

(in /var/www/html/redmine-1.2.1)
** Invoke db:migrate:upgrade_plugin_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Rails::Plugin::Dependencies
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:131:in `const_missing'
/var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `reloadable!'
/var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `each'
/var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `reloadable!'
/var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:51:in `evaluate_init_rb'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:158:in `evaluate_init_rb'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:154:in `evaluate_init_rb'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:48:in `load'
/var/www/html/redmine-1.2.1/config/../vendor/plugins/engines/lib/engines/plugin.rb:44:in `load'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin/loader.rb:38:in `load_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin/loader.rb:37:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin/loader.rb:37:in `load_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:369:in `load_plugins'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:165:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `send'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
/var/www/html/redmine-1.2.1/config/environment.rb:20
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/l开发者_如何学JAVAib/active_support/dependencies.rb:182:in `require'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/tasks/misc.rake:4
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/selfsimilar/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

script/about fails similarly:

$ RAILS_ENV=production script/about
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:131:in `const_missing': uninitialized constant Rails::Plugin::Dependencies (NameError)
    from /var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `reloadable!'
    from /var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `each'
    from /var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:47:in `reloadable!'
    from /var/www/html/redmine-1.2.1/vendor/plugins/redmine_google_calendar/init.rb:51:in `evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:158:in `evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:154:in `evaluate_init_rb'
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/rails/plugin.rb:48:in `load'
     ... 11 levels...
    from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/commands/about.rb:1
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/about:4

here's details of my environment, which, as I read the requirements page, are within spec for running Redmine 1.2.1.

$ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
$ gem -v
1.3.7
$ gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
arrayfields (4.7.0)
fastthread (1.0.1)
fattr (1.0.3)
git-rails (0.2.1)
hoe (1.8.3)
i18n (0.4.2)
main (2.8.3)
passenger (2.0.6)
rack (1.1.1)
rails (2.3.11)
rake (0.8.7)
rubyforge (1.0.2)
rubygems-update (1.5.0)
tzinfo (0.3.12)


The gem you are using is incompatible with your version of Rails, probably because the gem is out of date. Look around for a more up-to-date version or patch it yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜