Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku rails Procfile

I am very new to Heroku.

I uploaded my Rails app to Heroku and would like to run it with Thin instead of Webrick. Following Heroku’s guide I am supposed to use web: bundle exec rails server thin -p $PORT -e $RACK_ENV to create the procfile. However I always get the response web:: command not found.

What am I missing?

like image 989
Hans Adiputra Arijanto Avatar asked Apr 19 '12 21:04

Hans Adiputra Arijanto


People also ask

Is Procfile necessary Heroku?

A Procfile is not technically required to deploy simple apps written in most Heroku-supported languages—the platform automatically detects the language and creates a default web process type to boot the application server.

Is Procfile required?

A Procfile is not necessary to deploy most languages supported by Deis. The platform automatically detects the language and supplies a default web process type to boot the server. Creating an explicit Procfile is recommended for greater control and flexibility over your app.


2 Answers

You’re not supposed to run web: bundle exec rails server thin -p $PORT -e $RACK_ENV as a command, rather you create a new file called Procfile with that as its contents.

Either create the file and paste it in using your editor, or just do:

echo "web: bundle exec rails server thin -p \$PORT -e \$RACK_ENV" > Procfile 
like image 161
matt Avatar answered Sep 22 '22 11:09

matt


Have you bundled thin into your application?

gem 'thin' 

If not, you're looking at Rails trying to use the default server. Personally, I would look at using Unicorn on Heroku, but be careful with how many workers you might need.

http://neilmiddleton.com/the-procfile-is-your-friend. Cached version: https://web.archive.org/web/20130926005616/http://www.neilmiddleton.com/the-procfile-is-your-friend

http://neilmiddleton.com/getting-more-from-your-heroku-dynos

like image 34
Neil Middleton Avatar answered Sep 19 '22 11:09

Neil Middleton