Getting this Working on Your Computer
Download this repository and unzip.
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.
When you have installed RVM, open Terminal and direct the terminal to where you downloaded this repository, like so:
$ cd PLACE_YOU_DOWNLOADED_AND_UNZIPPED_THIS_REPOSITORY
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
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
- When you change any code in
app.rbyou'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
$ 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: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones and then run the following in Terminal:
heroku config:add TZ="____YOURTIMEZONE____"