在heroku雪松堆栈上部署sinatra app(使用config.ru)

我正在尝试重构我的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