Rails 2.3.8 I18n::UnknownFileType 文件类型 yml 未知

Rails 2.3.8 I18n::UnknownFileType the file type yml is not known

我这里有一个旧的 rails 项目 运行 rails 2.3.8 和 ruby 1.8.7 with rvm.

当我在 运行 rake -T 或其他 rake 任务时它会失败

I18n::UnknownFileType: can not load translations from /home/project/trunk/vendor/rails/activesupport/lib/active_support/locale/en.yml, the file type yml is not known

运行 控制台中的一些 YAML 可以工作。

我为 rails 3 和 ruby 1.9.3 (Rails 3: 'The file type yml is not known' when trying to access basic _form.html.erb) and rails 2.3 with ruby 2 (Rails legacy app and Ruby 2 error: can not load translations from the file type yml is not known) 找到了一些解决方案,但没有帮助。

我在这个项目中使用的宝石:

actionmailer (2.3.18)
actionpack (2.3.18)
activerecord (2.3.18)
activeresource (2.3.18)
activesupport (2.3.18)
afm (0.2.2)
Ascii85 (1.0.2)
bundler-unload (1.0.2)
color (1.8)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
hashery (2.1.1)
iconv (1.0.4)
little-plugger (1.1.4)
logging (2.0.0, 1.8.2)
multi_json (1.11.2)
mysql (2.9.1)
pdf-core (0.6.0)
pdf-reader (1.3.3)
pdf-writer (1.1.8)
prawn (2.0.2, 0.12.0)
rack (1.1.6)
rails (2.3.18)
rake (10.4.2, 10.1.1)
ruby-rc4 (0.1.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
transaction-simple (1.4.0.2)
ttfunk (1.4.0, 1.0.3)

script/consolescript/server 运行 很好。

我必须使用 ruby 1.8.7,无法更新。一个月内不可能升级到 rails 3 :)

你有什么想法来获得佣金任务吗运行?

最佳 罗伯特

我找到了解决方案:

有几个问题:

  1. rake (10.4.2, 10.1.1) 现在只使用 rake 10.1.1
  2. logging (2.0.0, 1.8.2) 现在只使用日志记录 1.8.2
  3. (测试后)必须在 Rakefile
  4. 中将 rdoctask 替换为 task

现在 rake -T 工作正常