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

4
我正在将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 这个命令在本地可以工作吗? - hjing
@hjing 本地运行 bundle exec rackup config.ru -p 31614 失败,提示信息为 configuration /home/.../config.ru not found - maudulus
1个回答

7

好的,关于在本地运行 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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接