This document describes the process of setting up a local development environment on Mac OS X.
Install the Homebrew package manager, if necessary:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install the PostgreSQL database management system, if necessary:
brew install postgresql
brew services start postgresql
createdbInstall the Ruby language (version 2.2.3), if necessary:
brew install rbenv
rbenv install 2.2.3
rbenv global 2.2.3Install the Bundler and Rails command line utilities, if necessary:
gem install bundler
gem install railsSetup environment variable(s) in your profile:
export TONEBASE_CLIENT_TOKEN="abc123" # shared with client application and excluded from version control
Download the source code:
git clone git@github.com:data-creative/tonebase-api.git
cd tonebase-api/
bundle installSetup the database:
bin/rake db:setupSeed the database:
bin/rake db:seedMigrate the database, if necessary:
bin/rake db:migrateRun a local web server:
bin/rails sRun a local rails console:
bin/rails cRun tests:
bundle exec rspec spec/Gain access to the Heroku application called "tonebase-api", then deploy when ready:
git pull origin master
git push origin master
git push heroku masterIf deploying for the first time, seed the production database:
heroku run "bin/rake db:seed"If the changes require a database migration, run:
heroku run "bin/rake db:migrate"