我正在尝试重构我的 sinatra 代码以将我的主文件分成单独的文件,使用一些技巧这个回应,并且我在部署到 heroku 时遇到了麻烦。
以前我没有config.ru
文件,并且刚刚使用了我的Procfile
,即:
web: bundle exec ruby web.rb -p $PORT
as per 本文.
从重构开始,我现在改变了我的Procfile
to
web: bundle exec thin -R config.ru start -p $PORT
With my config.ru
文件存在
root = ::File.dirname(__FILE__)
require ::File.join( root, 'web' )
run MyApp.new
And my 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上没有安装thin吗?或者有其他方法可以通过更改在heroku 上运行我的应用程序吗?