gpt4 book ai didi

ruby - Heroku 部署错误 H10 "configuration/app/config.ru not found"

转载 作者:数据小太阳 更新时间:2023-10-29 07:49:54 24 4
gpt4 key购买 nike

我正在将我的 Sinatra 应用程序部署到 Heroku,当我到达 heroku logs 时,我看到了以下跟踪:

State changed from crashed to starting
configuration /app/config.ru not found
State changed from starting to crashed
at=error code=H10 desc="App crashed" method=GET path=/ host=... request_id=... status=503 bytes=
...heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=... dyno= connect= service= status=503 bytes=
Starting process with command `bundle exec rackup config.ru -p 31614`
Process exited with status 1

怎么了 - 是不是我的 ruby​​ 版本 (ruby 1.9.3p484)...我真的不知道它可能是什么。在本地主机上一切正常。

最佳答案

好的,得到关于 bundle exec rackup config.ru -p 31614 在本地不工作的指针的答案。问题在于我没有添加 config.ru 文件。按照 https://devcenter.heroku.com/articles/rack 处的指南进行操作我简单地做了 touch config.ru,然后添加了以下行:

require './server.rb'
run Sinatra::Application

到我的 config.ru 文件。

然后我收到一条消息,应用程序不知道 pry 是什么:/app/server.rb:2:in 'require': cannot load such file -- pry (LoadError),所以我从 server.rb 中删除了 require 'pry',推送到 github:

git add -A
git commit -m "message"
git push

最后推送到heroku

git push heroku master

关于ruby - Heroku 部署错误 H10 "configuration/app/config.ru not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23771156/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com