【发布时间】:2020-01-27 05:45:22
【问题描述】:
我可以在开发中很好地运行我的 rails 应用程序:
rails s 然后转到 localhost:3000
但是,我需要测试生产并尝试过
rails s -e production,但是,当我转到 localhost:3000 时,我发现我的 rails 服务器没有任何反应。
=> Booting Puma
=> Rails 5.2.3 application starting in production
=> Run `rails server -h` for more startup options
Set localhost 3000 as the default_url_option ----
Puma starting in single mode...
* Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
为什么我无法访问我的生产 Rails 应用程序?有没有关于如何在本地机器上运行生产环境的具体教程?我正在使用 Mac OSX High Sierra。
【问题讨论】:
-
在浏览器上,是否出现错误?如何知道“看到”您的 Rails 服务器上没有任何反应?
-
注释输出到我启动服务器的终端
-
有一段时间没用过rails了,也许在生产模式下只记录错误?当您尝试访问服务器 url 时,浏览器中的结果是什么?
-
rails s -e production -b 0.0.0.0呢?
标签: ruby-on-rails ruby ruby-on-rails-5 production-environment