2013-12-22 29 views
1

我仍然遇到Ruby on Rails的问题。我运行rails(这是为我的openproject应用程序),我得到这个(在它工作之前)。我也想做一个笔记,我现在正在使用Ruby 2.0,而且我仍然得到相同的错误。未初始化常量I18n :: JS Ruby on Rails

require 'rails/all'... 0.850s 
Bundler.require... 7.700s 
/home/bistro/openproject/config/application.rb:89:in `<class:Application>': uninitialized constant I18n::JS (NameError) 
     from /home/bistro/openproject/config/application.rb:61:in `<module:OpenProject>' 
     from /home/bistro/openproject/config/application.rb:60:in `<top (required)>' 
     from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:53:in `require' 
     from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:53:in `block in <top (required)>' 
     from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:50:in `tap' 
     from /home/bistro/.rvm/gems/ruby-1.9.3-p484/gems/railties-3.2.16/lib/rails/commands.rb:50:in `<top (required)>' 
     from script/rails:6:in `require' 
     from script/rails:6:in `<main>' 
+0

我也想评论,我已经安装了i18n –

+0

我有点进一步我删除了application.rb中的中间件行,现在当我运行bundle exec来启动服务器时,我得到这.. –

+0

Bundler.require ... 7.130s =>引导薄 => Rails 3.2.16应用程序在http://0.0.0.0:3000上开发开始 –

回答

4

我工作的一个Rails应用程序灰烬和我有完全相同的问题,试图通过国际化-JS宝石(https://github.com/fnando/i18n-js)国际化的客户端。为了让更多的背景,我下面的说明这篇文章:http://eviltrout.com/2013/11/24/i18n-in-ember.html

在我的情况下,Rails的没有发现I18n::JS,因为它现在被称为SimplesIdeias::I18n(您可以通过在命令行中运行rake middleware看到它)。添加行

config.middleware.use SimplesIdeias::I18n::Middleware 

在application.rb文件中解决了我的问题,希望它有所帮助。

+0

对于宝石作者而言,不要告诉我们这个变化是非常蹩脚的。他们仅在3天前更新了宝石。 –

0

如果你现在就发生这样的事情。你的gemfile应该说类似gem'i18n-js',“> = 3.0.0.rc11”。否则,你将最终使用2.0版

相关问题