ActionController::Base:Class 的未定义方法`page_cache_extension' [英] undefined method `page_cache_extension' for ActionController::Base:Class

查看:32
本文介绍了ActionController::Base:Class 的未定义方法`page_cache_extension'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我在运行应用程序时收到ActionController::Base:Class 的未定义方法`page_cache_extension'"错误.

For some reason, I get the "undefined method `page_cache_extension' for ActionController::Base:Class" error when I run my application.

奇怪的是,它似乎只在我启动机器并启动服务器后的第一次启动时发生.如果我刷新页面 - 它加载正常.如果我重新启动服务器 - 它也可以正常工作.

The weird thing is that it seems to happen only on the first start after I boot my machine up and start the server. If I refresh page - it loads fine. If I restart my server - it works fine too.

我在 windows7 上使用 rails 3.0.9 和 ruby​​ 1.9.2,我认为它在我升级到 3.0.7 后开始发生.至少,在 3.0.3 中我没有得到这个.

I use rails 3.0.9 with ruby 1.9.2 on windows7 and I think it started happenning after I upgraded to 3.0.7. At least, with 3.0.3 I didn't get this.

这是跟踪:

[2011-06-28 15:16:39] INFO  WEBrick 1.3.1
[2011-06-28 15:16:39] INFO  ruby 1.9.2 (2011-02-18) [i386-mingw32]
[2011-06-28 15:16:39] INFO  WEBrick::HTTPServer#start: pid=5292 port=3000
[2011-06-28 15:27:18] ERROR NoMethodError: undefined method `page_cache_extension' for ActionController::Base:Class
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.9/lib/action_dispatch/middleware/static.rb:21:in `call'
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:168:in `call'
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/rack/log_tailer.rb:14:in `call'
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/content_length.rb:13:in `call'
    D:/dev/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/handler/webrick.rb:52:in `service'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Started GET "/" for 127.0.0.1 at 2011-06-28 15:27:21 +0400
  Processing by GamesController#index as HTML
  Category Load (2.0ms)  SELECT "categories".* FROM "categories"
  Game Load (17.0ms)  SELECT "games".* FROM "games" WHERE "games"."approved" = 't' AND "games"."published" = 't' ORDER BY approved_at DESC LIMIT 3

...

Rendered games/_game.haml (7.0ms)
Rendered games/index.haml within layouts/application (574.0ms)
Completed 200 OK in 638ms (Views: 586.0ms | ActiveRecord: 28.0ms)
[2011-06-28 15:27:23] ERROR Errno::ECONNABORTED: ��������� �� ����� ����-���������� ��������� ������������� �����������.
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:323:in `write'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:323:in `<<'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:323:in `_write_data'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:295:in `send_body_string'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:186:in `send_body'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpresponse.rb:103:in `send_response'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:86:in `run'
    D:/dev/Ruby192/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

推荐答案

我从 development.rb 中删除了以下几行

I removed the following lines from development.rb

config.action_view.debug_rjs             = true
config.action_controller.perform_caching = false

不确定这是否正确,但它对我有用.

Not sure if this is right, but it worked for me.

这篇关于ActionController::Base:Class 的未定义方法`page_cache_extension'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆