【问题标题】:My server is starting Webrick instead of Unicorm/Nginx on production我的服务器在生产中启动 Webrick 而不是 Unicorm/Nginx
【发布时间】:2015-06-23 20:25:28
【问题描述】:

我已按照以下步骤运行 Unicorn/Nginx 应用程序: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04 https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04

除了数据库说明(因为我将使用 Mongo)之外,我已经完成了那里指出的所有事情。但是,当我执行(ip 编辑)时:

RAILS_ENV=production rails server --binding=123.456.789.01

Webrick 服务器已启动:

/home/username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
=> Booting WEBrick
=> Rails 4.0.2 application starting in production on http://123.456.789.01:3000
=> Run `rails server -h` for more startup options

我需要检查什么才能使生产设置正常工作吗?我不知道我需要验证什么。

【问题讨论】:

    标签: ruby-on-rails ruby nginx unicorn webrick


    【解决方案1】:

    我相信你已经跳过了你提到的tutorial中的一些步骤......在你安装了unicorn和nginx之后你应该可以启动它们了:

    sudo service unicorn_appname start
    sudo service nginx restart
    

    【讨论】:

    • 我已经做到了。我刚刚重试了这些步骤,重新启动了 unicorn 和 nginx。没有报告错误。我试图重新启动服务器,这次我得到了: Booting WEBrick 服务器已经在运行。检查 /home/user/appname/tmp/pids/server.pid。有没有办法查看加载的页面是否实际上来自 unicorn 而不是来自 webrick?
    • 您不必运行 rails server (webrick)... 杀死所有服务并仅启动 nginx。您应该会看到 nginx 页面...现在启动 unicorn,如果配置正确,您应该会看到您的应用程序。请注意,unicorn 和 nginx 是 webrick 的替代品。
    • 所以,你是说我不需要运行:RAILS_ENV=production rails server --binding=server_public_IP 一旦 unicorn/nginx 正在运行
    • 是的...您不必运行它。看看这个教程以及gotealeaf.com/blog/…
    • 感谢您的回复。简而言之,我的问题是 nginx 需要重新启动,并且我正在运行启动 webrick 的非必需 Rails 服务器
    猜你喜欢
    • 2012-05-20
    • 2013-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-30
    • 2013-06-19
    • 1970-01-01
    相关资源
    最近更新 更多