生产中的Rails路由损坏 – 怀疑route.rb的缓存
更新:原来这个问题是因为我的杂种的一半没有重启。 谢谢大家的帮助!
嗨伙计们,我有一个紧急的问题。 基本上,我的路由可以在我的localhost上运行。 但是当我将其部署到生产环境时,路由似乎无法正常工作。
例如,给定一个新的路线“/邀请” – 有时我会得到一个404,有时它会正常工作。
我怀疑某处有一些缓存,但我不确定。
日志:当找不到页面时(当路线准确时)
处理UsersController #network(适用于2010-06-01 09:59:31的67.180.78.126)[GET]参数:{“id”=>“new”}
ActionController :: RoutingError(没有路由匹配“/ comm / role_playing_games”和{}):
app / controllers / application_controller.rb:383:在prev_page_label'
app/controllers/application_controller.rb:238:inprev_page_label'
app/controllers/application_controller.rb:238:inprev_page_label'
log_timed_info’
app/controllers/application_controller.rb:238:in
app / controllers / users_controller.rb:155:innetwork'
app/controllers/users_controller.rb:151:innetwork'
app/controllers/users_controller.rb:151:innetwork'
网络中’
app/controllers/users_controller.rb:151:in
app / controllers / application_controller.rb:44:inturn_on_query_caching'
app/controllers/application_controller.rb:43:inturn_on_query_caching'
app/controllers/application_controller.rb:43:inturn_on_query_caching'
turn_on_query_caching’
app/controllers/application_controller.rb:43:in
app / controllers / application_controller.rb:42:inturn_on_query_caching'
app/controllers/application_controller.rb:41:inturn_on_query_caching'
app/controllers/application_controller.rb:41:inturn_on_query_caching'
turn_on_query_caching’
app/controllers/application_controller.rb:41:in
app / controllers / application_controller.rb:40:inturn_on_query_caching'
app/controllers/application_controller.rb:39:inturn_on_query_caching'
app/controllers/application_controller.rb:39:inturn_on_query_caching'
turn_on_query_caching’haml(3.0.6)lib / sass / plugin / rack.rb:41:in`call’
app/controllers/application_controller.rb:39:in渲染/mnt/app/releases/20100524233313/public/404.html(404未找到)
从您发布的小信息来看,这肯定不是缓存或路由问题。
听起来你正在尝试生成一个人在ApplicationController
内的上一页的链接,你有一个错误。 您必须从application_controller.rb
发布相关代码。
您确定重新启动了服务器(如apache,ngix或passenger)吗? 此外,有时浏览器可以缓存url,只需关闭浏览器并重新打开它,看看是否可以修复它。
此外,一旦在蓝色的月亮,我将忘记将代码推送到GIT,因此生产服务器不会获得最新的代码。 只需检查您的服务器实际上是否有代码。