A standard Sinatra boilerplate, with Compass and Sass.
Getting things up and running
To get the boilerplate running, grab a copy locally.
Via Terminal / command line, navigate to the directory you downloaded Sinatra Boilerplate, and run the following:
# Install the appropriate Ruby gems (shorthand for bundle install) > bundle # Start the server > foreman start
The app will now be accessible at http://0.0.0.0:5000
Getting it onto Heroku
This will give you access to the following tools:
- Heroku (for Heroku on the command line)
- Git (for version control)
- Foreman (for running Sinatra locally)
Sign up for Heroku and login
Once you have an account for Heroku run the following in your terminal.
# Once you've installed the Heroku toolbelt, log in > heroku login
This will ask for your Heroku credentials.
# Enter your Heroku credentials. > Email: firstname.lastname@example.org > Password: ********
If you already have an SSH key set up on your local machine, you'll likely see the following. Heroku will help you set up a key, which makes deployment much quicker, meaning you don't have to enter your password every time you deploy. Win.
# If you haven't set up keys, Heroku will help you out. For example: # Could not find an existing public key. > Would you like to generate one? [Yn] # Generating new SSH public key. # Uploading ssh public key /Users/you/.ssh/id_rsa.pub
If you get a publickey error (access denied) when you try and push the site to Heroku, add your public key manually.
# Add your public key to Heroku manually > heroku keys:add
Next up, we set up the app and deploy it.
Deploy the app
Set up your Heroku stack and deploy the app to it.
> heroku create # Creating temp... done, stack is cedar # http://temp.herokuapp.com/ | email@example.com:temp.git # Git remote heroku added # Deploy the app > git push heroku master # Celebrate! > heroku open
Name it something fancy!
You can rename the app from the randomly generated http://random-subdomain.heroku.com/ to something more meaningful using:
# Rename your subdomain > heroku rename newname
This can be more awesome. I am sure of it. Fork it and get involved.