Skip to content

Instantly share code, notes, and snippets.

@micahbrich
Created September 19, 2014 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahbrich/b27ad1341bce77f73d1f to your computer and use it in GitHub Desktop.
Save micahbrich/b27ad1341bce77f73d1f to your computer and use it in GitHub Desktop.
The default rails server when you run it on your local computer is WEBrick, which is great for developing, but awful once a bunch of people start using it at once. Instead, let's add a new, more production-ready server in on Heroku, and add a file that tells Heroku to use it.
source 'https://rubygems.org'
group :production do
gem "thin"
end
web: bundle exec rails server thin -p $PORT -e $RACK_ENV
@micahbrich
Copy link
Author

I'm recommending a production server called 'thin' because it's well-tested and very reliable. Other servers exist, and if you want to research and experiment, you're welcome to.

To get this working, you'll have to add a new file in your root directory, and this will live right next to your Gemfile & Rakefile. You must name it 'Procfile', with no quotes and no extension – that's the file Heroku expects to see. Store that in your root directory, and make sure it's committed when you push to Heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment