[英]Heroku - Application Error H10 after insert config.ru in Sinatra app
[英]Deploying sinatra app (with config.ru) on heroku cedar stack
我正在嘗試重構我的sinatra代碼,將我的主文件分成單獨的文件,使用此響應中的一些提示,我遇到了部署到heroku的麻煩。
以前我沒有config.ru
文件,只使用了我的Procfile
,它是:
web: bundle exec ruby web.rb -p $PORT
根據這篇文章 。
從重構開始,我現在將我的Procfile
更改為
web: bundle exec thin -R config.ru start -p $PORT
我的config.ru
文件正在
root = ::File.dirname(__FILE__)
require ::File.join( root, 'web' )
run MyApp.new
我的web.rb
文件包含在類定義中
class MyApp < Sinatra::Application
# ...
end
這適用於我的本地開發計算機,但是當我部署到heroku時,我得到了
2011-12-01T11:21:54+00:00 app[web.1]: bundler: command not found: thin
2011-12-01T11:21:54+00:00 app[web.1]: Install missing gem executables with `bundle install`
2011-12-01T11:21:56+00:00 heroku[web.1]: State changed from starting to crashed
2011-12-01T11:22:01+00:00 heroku[router]: Error H10 (App crashed) -> GET [my app].herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2011-12-01T11:22:02+00:00 heroku[router]: Error H10 (App crashed) -> GET [my app].herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=
瘦是沒有安裝在heroku上? 或者是否有其他方法在heroku上運行我的應用程序?
我不得不更新我的Procfile
因為RACK_ENV
沒有傳遞到heroku環境。 Procfile
成為:
web: bundle exec thin -R config.ru start -p $PORT -e $RACK_ENV
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.