【问题标题】:Heroku Rails app R11 errorHeroku Rails 应用程序 R11 错误
【发布时间】:2013-04-11 15:06:19
【问题描述】:

我正在 Heroku 上部署 Rails 3.2.11 应用程序,并使用 Thin 作为我的服务器。当我推送到 Heroku 时,它启动 Thin 就好了,但它似乎也尝试启动 WEBrick。

我的Procfile如下:

web: bundle exec rails server -p $PORT thin -e $RACK_ENV

还有我的 Heroku 日志:

2013-04-11T14:52:28.276634+00:00 heroku[api]: Release v21 created by XXXXXX@gmail.com
2013-04-11T14:52:28.331285+00:00 heroku[api]: Deploy 6f63ed4 by XXXXXX@gmail.com
2013-04-11T14:52:28.432372+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-11T14:52:28.965697+00:00 heroku[slugc]: Slug compilation finished
2013-04-11T14:52:30.218480+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 9009 thin -e $RACK_ENV`
2013-04-11T14:52:32.898285+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-04-11T14:52:32.897830+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-04-11T14:52:34.350938+00:00 app[web.1]: [2013-04-11 14:52:34] INFO  WEBrick::HTTPServer#start: pid=2 port=2010
2013-04-11T14:52:34.350132+00:00 app[web.1]: [2013-04-11 14:52:34] INFO  WEBrick 1.3.1
2013-04-11T14:52:34.350707+00:00 app[web.1]: [2013-04-11 14:52:34] WARN  TCPServer Error: Address already in use - bind(2)
2013-04-11T14:52:34.350132+00:00 app[web.1]: [2013-04-11 14:52:34] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-04-11T14:52:34.407830+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-04-11T14:52:34.407675+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 2010, should be 9009 (see environment variable PORT)
2013-04-11T14:52:35.572955+00:00 heroku[web.1]: State changed from starting to crashed
2013-04-11T14:52:35.560772+00:00 heroku[web.1]: Process exited with status 137

为什么要这样做?我错过了什么?

【问题讨论】:

    标签: heroku ruby-on-rails-3.2


    【解决方案1】:

    尝试使用 Thin 而不是 WEBrick。您只需将其添加到您的 gemfile 即可:

    gem 'thin'
    

    然后运行bundle install,提交新的 Gemfile 和 Gemfile.lock,然后推送到 Heroku。

    WEBrick 不适用于生产用途。

    【讨论】:

    • 我正在使用 Thin 并且已成功完成所有这些步骤。问题是它同时启动了
    • 使用 Thin 更新后的错误日志更新您的问题
    • 另外,从$ heroku ps -a app_name发布你的Procfile和输出
    • 我一直在瘦。我的日志文件显示了它引导 Thin 的位置。我的 Procfile 也已经存在了。
    【解决方案2】:

    事实证明,我使用的插件 SyntaxHighlighter 在其测试目录中有一些文件启动了 WEBrick。我刚刚删除了那些,提交,推送,并且效果很好。

    【讨论】:

      猜你喜欢
      • 2016-04-01
      • 2014-11-19
      • 2014-03-12
      • 2015-10-31
      • 2013-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多