【问题标题】:Rails 4 - server works in development mode, but not in productionRails 4 - 服务器在开发模式下工作,但不在生产模式下
【发布时间】:2017-07-31 03:07:23
【问题描述】:

在开发模式下没有问题,但是当我在生产模式下启动服务器时,它会抛出

undefined method `request_id' for #<ActionDispatch::Request

我最近从 rails 5.1 降级到 rails 4.2.7,因为我的多态关联无法正常运行。

我用 puma 和 unicorn 都试过了,所以我不认为问题出在服务器上。

完整的堆栈要点https://gist.github.com/itsgucci/c0fbc29d2122e648fd90cc5de418dce5

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4


    【解决方案1】:

    您的 production.rb 中似乎启用了请求 id 的日志记录,它看起来像这样:

    config.log_tags = [ :request_id ]  
    

    你可以把它注释掉,一切都应该正常工作。

    【讨论】:

      猜你喜欢
      • 2021-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多