将应用程序升级到Ruby 1.8.7,Rails 3并为SiteSweeper获取未定义的方法`config_accessor':Class

时间:2012-02-15 23:36:37

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

我正在努力将应用程序升级到Rails 3(Ruby 1.8.7),而我当前的障碍是在运行'rake test --trace'时我得到以下内容:

** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Invoke test:functionals (first_time)
** Invoke test:prepare
** Execute test:functionals
DEPRECATION WARNING: "Rails.root/test/mocks/test" won't be added automatically to load paths anymore in future releases. (called from <APP PATH>/config/application.rb:17)
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.0.11/lib/action_controller/caching/pages.rb:47: undefined method `config_accessor' for SiteSweeper:Class (NoMethodError)
        from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.11/lib/active_support/concern.rb:52:in `class_eval'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.11/lib/active_support/concern.rb:52:in `append_features'
        from <APP PATH>/app/sweepers/site_sweeper.rb:4:in `include'
        from <APP PATH>/app/sweepers/site_sweeper.rb:4
        from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
        from C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
...

此处的错误指向实际位于Rails 3.0.11 gem(action_controller / caching / pages.rb:47)中的代码,我无法弄清楚为什么会导致问题或为什么我找不到任何问题其他人有这个问题。我也在寻找ActionController :: Caching的文档,看看'config_accessor'是否会消失..?

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

我不确定这是完整的答案,但对于我正在升级'test / mocks'目录的应用程序,其中没有任何内容。删除目录删除了弃用消息。