我最近更新了我的Ruby on Rails项目,然后当我尝试运行时
rake i18n:js:export
命令,我收到以下错误
uninitialized constant I18n::INTERPOLATION_PATTERN
这在Windows 8.1和centos6机器中都会发生。
我的ruby版本是:Windows中为1.8.7,CentOS6中为1.9.3 Rails版本:3.0.9
我在这个地方一无所知,并试图找到一个解决方案,但找不到正确的解决方案。
我正在使用i18n-js version 2.1.2
我尝试将其更新为version 3.0.0.rc5
,但仍然没有运气。
有人遇到过类似的问题吗?我迫不及待地想要一个解决方案来解决这个问题。
/ *跑步后的结果* /
**调用i18n:js:export(first_time) **调用环境(first_time) **执行环境 **执行i18n:js:export rake aborted!未初始化的常数I18n :: INTERPOLATION_PATTERN C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:72:在
block in configured_segments' c:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:70:in
每个” C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:70:在each_wit h_object' c:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:70:in
configur ed_segments' C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:83:在translat ion_segments' c:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js.rb:46:in
出口!“C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-js-2.1.2/lib/i18n-js/rake.rb:9:在
bloc k (2 levels) in <top (required)>' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in
称之为” C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:在block i n execute' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in
每个” C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:在execute ' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in
阻止我调用_with_call_chain' c:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:在mon_synchronize' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in
invoke_ with_call_chain'中 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:在 `调用'C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:在 top_level中
invoke_task' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in
阻止(2个级别) C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:在 top_level中的each' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in
阻止' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:在run_with_threads' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in
top_level' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:在b lock in run' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in
standard_exception_handling' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:在r un' c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in
'c:/ Ruby193 / bin / rake:23:inload' c:/Ruby193/bin/rake:23:in
'任务:TOP =&gt; I18N:JS:出口
由于
答案 0 :(得分:0)
我知道这是一个过时的问题,但你可能想看看最近这个问题。它详细介绍了我遇到类似问题的方式以及解决方法:
upgrading to ruby 2.3.0 NameError: uninitialized constant I18n::Config::Backend
查看您的rake文件,看看您是否有任何对翻译助手的引用。
删除包含ActionView::Helpers::TranslationHelper
并将(t "some_text")
替换为(I18n.t "some_text")
完全解决了该问题。