When it comes to publishing web (or API-only) apps, I either pick Openshift or Heroku for hosting. Both services are great but when it comes to building for Sinatra, Heroku is just a tiny bit easier to use.
Both services use git repository to store your code so you'll be using a little bit of command line.
At some point, you might find yourself using environmental variables to configure your app. Examples include a path to your database URL or maybe a reference to an AWS bucket. It's so common that Heroku pretty much suggests you do this from the beginning.
First things first, make sure that you never save .env to git. EVER!
echo .env >> .gitignore
Copy any config vars from Heroku to your local .env
heroku config:get CONFIG-VAR-NAME -s >> .env
WARNING, IF YOU DO NOT COMPLETE STEP 1 CORRECTLY, YOU WILL LIKELY RUN INTO PROBLEMS
Heroku is super simple to use but that doesn't mean you can skimp over these configuration details. This is the stuff that makes your web app unique from the millions of other web apps out there.
Step 2 - Save your work
Heroku uses git for a code repository. This is great because most modern web apps today use git.
Make sure you're working within your web app
Start working with a local git repo.
Add the files to git.
git add -A
Commit the files and write a comment.
git commit -m 'initial commit'
Push the files to git master
git push origin master
Step 3 - Publishing to Heroku
Double check and make sure you're logged into the right Heroku account.
Create a Heroku app
#create the app
heroku create --stack cedar
Publish the git files to Heroku's git repository
#push the app live
git push heroku master
If your app doesn't load an you want to see the logs: