Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Sinatra Boilerplate

A standard Sinatra boilerplate, with Compass and Sass.

This is a Heroku ready Sinatra app put together by Charlie Gleason (with help from John Barton).

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

To deploy to Heroku, first up, install the Heroku Toolbelt.

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: adam@example.com
> 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/ | git@heroku.com:temp.git
# Git remote heroku added

# Deploy the app
> git push heroku master

# Celebrate!
> heroku open

Joy!

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

Contribute

This can be more awesome. I am sure of it. Fork it and get involved.

About

A standard Sinatra boilerplate, with Compass and Sass.

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.