Development environment setup - 1000Memories/Documentation GitHub Wiki

To run our development environment locally, you will need the following software (scroll down for a more detailed walkthrough)

Required software

  • Git
  • PostgreSQL 9.X
  • Redis
  • foreman (Heroku CLI tool)
  • Ruby Version Manager (RVM)

Recommended software

See below for a walkthrough on how to get set up (note that some parts are Mac-specific).

1. Install Xcode

Install Xcode via App Store. Open it up, go through the setup, then go to Xcode > Preferences. Select the Downloads tab and install Command Line Tools to get GCC.

Note: possibly outdated step:

Also, run this command to symlink gcc to llvm: sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

2. Setup Heroku CLI tools

Go to https://toolbelt.heroku.com/ and download Heroku Toolbelt, which gives you the heroku command line tool, and foreman for running Procfiles. This will also install git if is not already installed.

3. Setup Git

If you installed Heroku Toolbelt (above) you should now have git.

Create a GitHub account if you don't already have one.

To setup git, either (a) download GitHub for Mac from http://mac.github.com, which will walk you through the process, or (b) create a .gitconfig file and enter the following content:

[user]
    name = Your Name
    email = [email protected]

Note: the email above should be one that is associated with your GitHub account.

For additional setup instructions, such as setting up the keychain for GitHub, see here: https://help.github.com/articles/set-up-git

4. PostgreSQL

Install Postgres from http://postgresapp.com/

Since Mac OS X 10.7 and later comes with an older postgres, you have to add the following to ~/.bash_profile file or your equivalent shell dotfile (create .bash_profile if it doesn't exist)

export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

Next, either reload your bash session or restart the terminal. You can confirm that you're running the correct postgres by entering which postgres into your terminal (it should output /Applications/Postgres.app/...).

Next, create a superuser role with the name postgres:

createuser postgres -s

Download pgadmin

Download pgadmin from:

In pgadmin, go to File > Add Server. Give it a name of localhost, port 5432, username postgres.

Then, add the following databases to that new server: acom_bandido_development and acom_bandido_test. (Right click on 'Databases' in the left sidebar of pgAdmin. Then hit 'New Database')

5. Install redis

Go to http://redis.io/download and download the stable version. Unzip the file, cd into the directory, and run make install. This will generate a redis-server binary in the src directory. You'll need to start this redis-server binary before running some of our projects.

6. Setup Ruby/RVM

Install RVM (Ruby Version Manager):

\curl -L https://get.rvm.io | bash -s stable --ruby

This should add a few lines to your ~/.bash_profile and ~/.bashrc that load RVM into the shell.

Restart your session/terminal so that these changes take effect.

7. Setup our codebase

Clone the repo and cd into it

git clone [email protected]:1000Memories/acom-bandido-plus.git
cd acom-bandido-plus

If you installed RVM correctly, it should prompt you to install Ruby. Press y to accept. This may take a while to install everything. Once it's installed, you can confirm that you're using the correct Ruby version by running ruby -v, which should output version 1.9.3.