I have simple Sinatra app.
web.rb:
require 'sinatra'
get '/' do
"Hello"
end
Gemfile:*
source :rubygems
gem 'sinatra', '1.1.0'
gem 'thin', '1.2.7'
config.ru:
require './web'
run Sinatra::Application
But when I deploy my app on Heroku I'll get the error on logs:
2012-03-27T19:17:48+00:00 heroku[router]: Error H14 (No web processes running) -> GET furious-waterfall-6586.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
How can I fix it?
By adding the gem 'heroku' to the Gemfile, I got it working. No Procfile needed.
I have had this problem a number of times in the past, and it was all because I didn't include my config.ru file with the requiring of [app].rb & then pushing to Heroku. Even if I added it afterwards and restarted, Heroku would never pick it up.
Then remove the remote from your project folder
Then recreate the app
As an update, here is a slightly more minimal app that I created, and confirmed to be working as of today. The thin gem was not needed, and a Procfile was not needed to get an initial working app.
Gemfile
config.ru
Note: The require line uses './app' instead of 'app'.
app.rb
If you want to use this template, you can copy it, bundle, and push the Git repo.
Here's how to create a minimal sinatra app that deploys to heroku:
app.rb:
Gemfile:
config.ru:
Type these commands in your command line to deploy (without the
$
signs):Then test your app:
and you should see:
try to restart heroku
here more discussion: unknown heroku error
You need a
Procfile
file alongside yourconfig.ru
to tell Heroku how to run your app. Here is the content of an exampleProcfile
:Heroku Ruby docs on Procfiles
EDIT: Here's a sample
config.ru
from one of my sinatra/Heroku apps:You may need to require sinatra and rubygems for it to work.