No description, website, or topics provided.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 29 commits ahead, 12 commits behind runemadsen:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore A lot of changes to simplify this repository Feb 28, 2013

Sinatra-Heroku Template

Getting this Working on Your Computer

  1. Download this repository and unzip.

  2. Install RVM, it's the best way to install Ruby on your computer and prevent anything you do with Ruby from messing up your system.

  3. When you have installed RVM, open Terminal and direct the terminal to where you downloaded this repository, like so:

  4. Now we must install the gems. Gems are what Ruby calls libraries. To do so we need to install a different gem first:

     $ gem install bundler
     $ bundle install --without production
  5. To run the app, use the following command:

     $ bundle exec rackup

This command creates a server on your computer running at http://localhost:9292. Type that in to a web browser on your computer and you should see the contents of views/index.erb.

  1. When you change any code in app.rb you'll need to restart the server. To stop the server type "CTRL+C" in Terminal. and then repeat step 5.

Heroku App Creation

To create a Heroku app, first be sure you are signed up.

Install the Heroku gem (may require sudo):

$ gem install heroku

Then type the following in Terminal while inside of the project directory.

$ heroku create NAME_OF_YOUR_APP

Once this returns successfully, push your app to Heroku.

$ git push heroku master

Setting Up the Database on Heroku

In order to run a database on Heroku follow their steps for adding Postgres here. Be sure to sign up for the "dev" plan to avoid being charged.

Once you have completed the steps for provisioning a database we need to migrate our database. It's quite simple:

$ heroku run irb
> require './app'
> DataMapper.auto_upgrade!
> exit


Heroku's servers have different timestamps than your time zone probably. To have Heroku use your local time zone for timestamps on datamodels find your timezone on this chart: and then run the following in Terminal:

heroku config:add TZ="____YOURTIMEZONE____"