Development Setup
Version 4 (J. Simmons, 10/16/2011 06:58 pm)
| 1 | 1 | Matthew Sears | h1. Development Setup |
|---|---|---|---|
| 2 | 1 | Matthew Sears | |
| 3 | 2 | J. Simmons | The following instructions are meant to help get the ODE application up and running on your local workstation. Note, these instructions assume you are setting up a development environment on Linux/OS X. |
| 4 | 1 | Matthew Sears | |
| 5 | 3 | J. Simmons | h1. Prerequisites |
| 6 | 3 | J. Simmons | |
| 7 | 3 | J. Simmons | * SVN |
| 8 | 3 | J. Simmons | |
| 9 | 3 | J. Simmons | |
| 10 | 1 | Matthew Sears | h1. Code checkout |
| 11 | 1 | Matthew Sears | |
| 12 | 1 | Matthew Sears | To get started, create a local repository with svn checkout: |
| 13 | 1 | Matthew Sears | |
| 14 | 1 | Matthew Sears | <pre> |
| 15 | 1 | Matthew Sears | svn checkout https://opendesignengine.net/svn/ode/trunk |
| 16 | 1 | Matthew Sears | </pre> |
| 17 | 1 | Matthew Sears | |
| 18 | 1 | Matthew Sears | h1. Create Development Database |
| 19 | 1 | Matthew Sears | |
| 20 | 1 | Matthew Sears | You will need to setup a local development MySQL database and call 'ode_development'. Next we need to create a new database.yml so the application knows how to connect to the database. To accomplish this, simple copy the database.yml.exampe file: |
| 21 | 1 | Matthew Sears | |
| 22 | 1 | Matthew Sears | <pre> |
| 23 | 4 | J. Simmons | cp config/database.yml.example config/database.yml |
| 24 | 1 | Matthew Sears | </pre> |
| 25 | 1 | Matthew Sears | |
| 26 | 1 | Matthew Sears | Under the production: section of the the config fill, fill in the database name, username, and password. |
| 27 | 1 | Matthew Sears | |
| 28 | 1 | Matthew Sears | h1. Bundler |
| 29 | 1 | Matthew Sears | |
| 30 | 1 | Matthew Sears | To install the required third-party gems to run the ODE application, we run the following Bundler command: |
| 31 | 1 | Matthew Sears | |
| 32 | 1 | Matthew Sears | <pre> |
| 33 | 1 | Matthew Sears | bundle install |
| 34 | 1 | Matthew Sears | </pre> |
| 35 | 1 | Matthew Sears | |
| 36 | 1 | Matthew Sears | Note: you will need to install Bundler first (gem install bundler) |
| 37 | 1 | Matthew Sears | |
| 38 | 1 | Matthew Sears | h1. Database Preparation |
| 39 | 1 | Matthew Sears | |
| 40 | 1 | Matthew Sears | To prepare the database, we first need to run migrations: |
| 41 | 1 | Matthew Sears | |
| 42 | 1 | Matthew Sears | <pre> |
| 43 | 1 | Matthew Sears | RAILS_ENV=production rake db:migrate |
| 44 | 1 | Matthew Sears | </pre> |
| 45 | 1 | Matthew Sears | |
| 46 | 1 | Matthew Sears | We now need some seed data to get started: |
| 47 | 1 | Matthew Sears | |
| 48 | 1 | Matthew Sears | <pre> |
| 49 | 1 | Matthew Sears | RAILS_ENV=production rake db:seed |
| 50 | 1 | Matthew Sears | </pre> |
| 51 | 1 | Matthew Sears | |
| 52 | 1 | Matthew Sears | h1. Running the Application |
| 53 | 1 | Matthew Sears | |
| 54 | 1 | Matthew Sears | Now we should be ready to run the application locally: |
| 55 | 1 | Matthew Sears | |
| 56 | 1 | Matthew Sears | <pre> |
| 57 | 1 | Matthew Sears | RAILS_ENV=production script/server |
| 58 | 1 | Matthew Sears | </pre> |
| 59 | 1 | Matthew Sears | |
| 60 | 1 | Matthew Sears | If all goes well, you should be able to open the application at http://localhost:3000 |