【问题标题】:rails in production mode doesn't render index.html生产模式下的 rails 不会呈现 index.html
【发布时间】:2011-04-12 09:31:04
【问题描述】:

我在生产模式下尝试了我的应用程序,但我的公用文件夹中的 index.html 文件没有被渲染,我收到了 ActionController::RoutingError (No route matches "/"): 错误。

index.html 文件在开发和测试环境中正确呈现。这怎么可能?

【问题讨论】:

  • 您的应用程序前面有网络服务器吗?你激活静态渲染了吗?
  • 就是这样,我没有真正的网络服务器,只有 webrick

标签: ruby-on-rails routes production


【解决方案1】:

通过将 rails 放入像 apache 这样的真实网络服务器中解决了这个问题,因为生产模式下的 rails 永远不会提供静态内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-20
    • 2012-07-21
    • 2014-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多