8
我試圖重構我的sinatra代碼以將我的主文件分隔爲單獨的文件,使用this response的一些提示,並且我正在將問題部署到heroku。在heroku雪松堆棧上部署sinatra應用程序(使用config.ru)
以前我沒有一個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
這適用於我本地的開發ent電腦,但是當我部署到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上運行我的應用程序的變化?
好的,所以我不需要改變config.ru使用Sinatra :: Application而不是MyApp.new。從答案中刪除它。 – zlog