ruby-on-rails - 未检测到 Procfile,使用默认 Web 服务器 (webrick)

标签 ruby-on-rails ruby windows heroku procfile

我在尝试部署我的 Ruby on Rails 应用程序时遇到此错误。这是我的命令行中的错误:

 ###### WARNING:
remote:        No Procfile detected, using the default web server (webrick)
remote:        https://devcenter.heroku.com/articles/ruby-default-web-server

remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> (none)
remote:        Default types for Ruby  -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 29.5MB
remote: -----> Launching... done, v21
remote:        https://agile-sea-1900.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/agile-sea-1900.git
   e5d3ad8..975d5eb  master -> master

我尝试遵循“No Procfile detected, using the default web server”中的建议 [ archive.org ] - 捆绑 thin gem 并创建包含以下内容的 Procfile:

web: bundle exec thin start -p $PORT

但这并没有帮助。

最佳答案

在评论中给出的信息之上,您有此错误是因为在您的 Procfile 中,您有:

web: bundle exec rails server -p $PORT

因此将使用默认的 webrick

为了消除此警告,您应该使用另一个 Web 服务器,例如 Unicorn、Thin 或 Puma。

Heroku 现在提倡使用 Puma(参见 Changelog)。

要开始使用 Puma 和 Heroku,您可以关注文章 Deploying Rails Applications with the Puma Web Server在 Heroku 网站上。

关于ruby-on-rails - 未检测到 Procfile,使用默认 Web 服务器 (webrick),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30085101/

相关文章:

ruby - 按每个恒定间隔的迭代次数进行基准测试

python - 如何让py2exe内置版权信息

java - Monitor USB IO "traffic"(任何语言)

ruby-on-rails - Rails 4/postgresql - 根据另一个表数据在一个表上插入数据(after_create)

ruby-on-rails - RVM gemset 创建不工作

python - 将行转换为列

c++ - 如何准备一个恒定的基准环境

mysql - 使用生产数据库值填充开发数据库

ruby-on-rails - 在一个声明中使用 ActiveRecord 序列化多个属性?

ruby - 如何在 Ruby 中进行防御性编程?