在Rails 2.3期间未定义的方法转换 - > 3.2升级

时间:2016-07-02 08:59:51

标签: ruby-on-rails-3 ruby-on-rails-3.2 ruby-1.9.3 rails-3-upgrade

将Rails 2.3.17应用程序升级到Rails 3.2.22.2(运行ruby 1.9.3-p551)。能够通过ugprading所有gems的痛苦部分/更新目录结构/添加所有新的/更新的rails文件。

rails服务器现在正在出现,但是当我尝试加载第一页时,它会因此堆栈跟踪而失败:

from t77_date.constants import ISO_FRIDAY
from t77_date.datetime import set_prev_iso_week_day


datenow = set_prev_iso_week_day(datenow, ISO_FRIDAY).replace(hour=16,minute=0,second=0,microsecond=0)

...

附加说明:我在config / initializers /文件夹中有一个locale.rb文件,其中包含:

NoMethodError: undefined method `translate' for #   <I18n::Backend::ActiveRecord:0x007ff64dc72400>
/myapp/vendor/bundle/ruby/1.9.1/gems/i18n-0.7.0/lib/i18n/backend/chain.rb:46:in `block (2 levels) in translate'
/myapp/vendor/bundle/ruby/1.9.1/gems/i18n-0.7.0/lib/i18n/backend/chain.rb:44:in `catch'
/myapp/vendor/bundle/ruby/1.9.1/gems/i18n-0.7.0/lib/i18n/backend/chain.rb:44:in `block in translate'
/myapp/vendor/bundle/ruby/1.9.1/gems/i18n-0.7.0/lib/i18n/backend/chain.rb:43:in `each'

我的Gemfile看起来像:

require "i18n/backend/cache"

I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Flatten)
I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
I18n::Backend::Chain.send(:include, I18n::Backend::Cache)
I18n.backend = I18n::Backend::ActiveRecord.new
I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n.backend)

为什么它可能会生成该错误消息的任何想法?

0 个答案:

没有答案