【问题标题】:Heroku Deployment error H10 "configuration /app/config.ru not found"Heroku 部署错误 H10“未找到配置 /app/config.ru”
【发布时间】:2014-07-09 09:15:03
【问题描述】:

我正在将我的 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)...我真的不知道它可能是什么。在 localhost 中一切正常。

【问题讨论】:

  • 命令bundle exec rackup config.ru -p 31614在本地工作吗?
  • @hjing bundle exec rackup config.ru -p 31614 在本地不起作用。相反,我收到消息configuration /home/.../config.ru not found

标签: ruby heroku deployment sinatra


【解决方案1】:

好的,得到了​​关于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.rufile。

然后我得到一个应用程序不知道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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-24
    • 2021-03-20
    • 1970-01-01
    • 2019-06-12
    • 1970-01-01
    • 1970-01-01
    • 2016-12-25
    • 2021-08-17
    相关资源
    最近更新 更多