Redmine插件:未初始化的常量I18n

时间:2009-05-18 18:07:18

标签: ruby plugins redmine

我们刚刚安装了Redmine Charts(http://github.com/mszczytowski/redmine_charts/tree/master)和相关的OpenFlashChart插件,但是当我们启动Ruby服务器时,我们得到以下错误。我们的步骤是:

  1. 下载图表的tar文件
  2. 进入$ REDMINE_ROOT / plugins dir
  3. $ REDMINE_ROOT / script / plugin install http://svn.pullmonkey.com/plugins/trunk/open_flash_chart/
  4. 尝试启动服务器

    =>启动WEBrick ... /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:276:in load_missing_constant': uninitialized constant Redmine::I18n (NameError) from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:468:in const_missing' 来自/usr/local/apps/redmine-0.8/vendor/plugins/mszczytowski-redmine_charts-e3c5010466d7585d987bc1018e94daee90906a5d/lib/redmine_charts/line_data_converter.rb:4 来自/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' 来自/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in require' from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in new_constants_in' 来自/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in require' from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:102:in require_or_load'  ... 27级...... 来自/usr/lib64/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:39 来自/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' 来自脚本/服务器:3

2 个答案:

答案 0 :(得分:1)

查看redmine_charts的来源,它需要Redmine :: I18n - 有几个“包含Redmine :: I18n”的实例。

有关Rails,Redmine和I18n的更多信息,另请参阅http://www.redmine.org/news/22

您可能会遇到版本控制(Rails和Redmine)问题。

答案 1 :(得分:1)

Redmine的I18n是多种语言的最新成员。它仅在Redmine的主干版本中可用,0.8.x版本的Redmine使用较旧的GLoc插件。

您有几种方法可以解决此问题:

  • 升级到Redmine的主干版本
  • 要求开发人员使插件与Redmine的发布版本兼容(我个人为我的Redmine插件执行此操作)
  • 或尝试自行解决I18n错误

要修复错误,您需要浏览代码并将I18n的所有提及替换为GLoc,然后在插件lang/目录中创建旧版本的翻译

Eric Davis