Created
September 19, 2014 23:06
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
group :production do | |
gem "thin" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec rails server thin -p $PORT -e $RACK_ENV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.