首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ActionController::Base:Class的未定义方法`page_cache_extension

ActionController::Base:Class的未定义方法`page_cache_extension
EN

Stack Overflow用户
提问于 2011-06-28 19:38:12
回答 7查看 11.5K关注 0票数 28

由于某些原因,当我运行我的应用程序时,我得到了"undefined method `page_cache_extension‘For ActionController::Base:Class“错误。

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

我在windows7上使用rails 3.0.9和ruby 1.9.2,我想这是在我升级到3.0.7之后开始发生的。至少,在3.0.3版本中,我没有得到这个。

下面是跟踪信息:

代码语言:javascript
复制
[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'
EN

回答 7

Stack Overflow用户

发布于 2012-01-26 01:24:25

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

代码语言:javascript
复制
config.action_view.debug_rjs             = true
config.action_controller.perform_caching = false

不知道这样做对不对,但对我来说很管用。

票数 16
EN

Stack Overflow用户

发布于 2012-12-14 23:43:23

在升级操作系统后,我也遇到了同样的问题。如果设置是使用RVM完成的,请仅使用以下命令:

代码语言:javascript
复制
rvm repair all
票数 11
EN

Stack Overflow用户

发布于 2012-03-14 03:20:05

在我将haml添加到我的Gemfile之后,我得到了这个错误。这似乎是rails 3.1的rails更新中的一个错误

将rails更新到3.2.2并将haml更新到3.1.4修复了该问题。更多关于bug的信息可以在found here上找到。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6505817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档