【问题标题】:No Procfile detected, using the default web server (webrick)未检测到 Procfile,使用默认 Web 服务器 (webrick)
【发布时间】:2015-07-17 02:00:23
【问题描述】:

我在尝试部署我的 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

但这并没有帮助。

【问题讨论】:

  • 我没有看到任何错误,只是警告。 heroku logs 显示什么? devcenter.heroku.com/articles/logging#log-retrieval
  • Procfile的内容是什么?
  • 确保 P 在 Procfile 中是大写
  • 我的 Procfile 包含 - 'web: bundle exec rails server -p $PORT'
  • 所以如果你使用Thin,你需要在你的Procfile中用thin替换rails server

标签: ruby-on-rails ruby windows heroku procfile


【解决方案1】:

就我而言,由于其他在线指南页面,我忽略了 .gitignore 中的 Procfile。当时,他们给出了隐藏文件的指令,这些文件声明了包含邮件帐户信息的环境变量。 因此,请检查您的 .gitignore 文件,如果您在其中看到 Procfile 则将其删除。

【讨论】:

    【解决方案2】:

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

    web: bundle exec rails server -p $PORT
    

    所以会使用默认的webrick

    要删除此警告,您应该使用其他 Web 服务器,例如 Unicorn、Thin 或 Puma。

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

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

    【讨论】:

    • 除了默认为 Webrick 之外,Procfile 中的错误是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-02
    • 2021-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-17
    • 2014-04-24
    相关资源
    最近更新 更多