Deploying the sinatra application (from config.ru) on the hedge cedar stack

I'm trying to reorganize my sinatra code to split my main file into separate files using a few tips from this answer , and I'm having trouble deploying Heroku.

Previously, I did not have a config.ru file and I used only the Procfile , which was:

 web: bundle exec ruby web.rb -p $PORT 

according to this article .

From refactoring, I now changed my Procfile to

 web: bundle exec thin -R config.ru start -p $PORT 

With my config.ru file

 root = ::File.dirname(__FILE__) require ::File.join( root, 'web' ) run MyApp.new 

And my web.rb file is contained in the class definition

 class MyApp < Sinatra::Application # ... end 

This works on my local development computer, but when I deploy to the hero, I get

 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= 

Thin is not installed on the hero? Or is there some other way to launch my application on the hero with the changes?

+8
ruby deployment heroku sinatra
source share
1 answer

I had to update my Procfile because RACK_ENV not being passed to the heroku environment. Procfile became:

 web: bundle exec thin -R config.ru start -p $PORT -e $RACK_ENV 
+9
source share

All Articles