Development Setup
Version 25 (Camdon Cady, 12/06/2014 02:47 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 | 20 | Camdon Cady | * MySQL (Currently tested with MySQL v5.1) |
9 | 9 | J. Simmons | * Ruby 1.8.7 (with Development Tools) |
10 | 24 | Camdon Cady | * MySQL header files (i.e. package libmysqlclient-dev on Debian-based systems) |
11 | 14 | Jeremy Wright | * Bundler (may need to update gem to 1.4+) |
12 | 14 | Jeremy Wright | <pre>gem install bundler</pre> |
13 | 19 | Camdon Cady | ** To update gem you may need to run (su to root): |
14 | 14 | Jeremy Wright | <pre>REALLY_GEM_UPDATE_SYSTEM=1 gem update --system</pre> |
15 | 19 | Camdon Cady | ** After this update you'll need to reinstall bundler. |
16 | 20 | Camdon Cady | * Install Ruby on Rails (Currently tested with Rails v2.3.16) |
17 | 20 | Camdon Cady | <pre>gem install rails --include-dependencies -v 2.3.16</pre> |
18 | 3 | J. Simmons | |
19 | 1 | Matthew Sears | h1. Code checkout |
20 | 1 | Matthew Sears | |
21 | 1 | Matthew Sears | To get started, create a local repository with svn checkout: |
22 | 1 | Matthew Sears | |
23 | 1 | Matthew Sears | <pre> |
24 | 1 | Matthew Sears | svn checkout https://opendesignengine.net/svn/ode/trunk |
25 | 1 | Matthew Sears | </pre> |
26 | 1 | Matthew Sears | |
27 | 1 | Matthew Sears | h1. Create Development Database |
28 | 1 | Matthew Sears | |
29 | 25 | Camdon Cady | You will need to setup a local development MySQL database and call it 'ode_development'. |
30 | 1 | Matthew Sears | |
31 | 21 | Camdon Cady | To create the database, run the following commands: |
32 | 21 | Camdon Cady | |
33 | 21 | Camdon Cady | <pre> |
34 | 1 | Matthew Sears | mysql -u root -p |
35 | 1 | Matthew Sears | |
36 | 1 | Matthew Sears | mysql> create database ode_development character set utf8; |
37 | 1 | Matthew Sears | mysql> create user 'ode_development'@'localhost' identified by 'my_password'; |
38 | 1 | Matthew Sears | mysql> grant all privileges on ode_development.* to 'ode_development'@'localhost'; |
39 | 1 | Matthew Sears | mysql> exit |
40 | 1 | Matthew Sears | </pre> |
41 | 1 | Matthew Sears | |
42 | 25 | Camdon Cady | 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: |
43 | 25 | Camdon Cady | |
44 | 25 | Camdon Cady | <pre> |
45 | 25 | Camdon Cady | cd trunk |
46 | 25 | Camdon Cady | cp config/database.yml.example config/database.yml |
47 | 25 | Camdon Cady | </pre> |
48 | 25 | Camdon Cady | |
49 | 25 | Camdon Cady | Under the development: section of the the config file, fill in the database name, username, and password. |
50 | 25 | Camdon Cady | |
51 | 1 | Matthew Sears | h1. Bundler |
52 | 1 | Matthew Sears | |
53 | 1 | Matthew Sears | To install the required third-party gems to run the ODE application, we run the following Bundler command: |
54 | 1 | Matthew Sears | |
55 | 1 | Matthew Sears | <pre> |
56 | 1 | Matthew Sears | bundle install |
57 | 15 | Jeremy Wright | </pre> |
58 | 1 | Matthew Sears | |
59 | 1 | Matthew Sears | h1. Database Preparation |
60 | 1 | Matthew Sears | |
61 | 1 | Matthew Sears | To prepare the database, we first need to run migrations: |
62 | 1 | Matthew Sears | |
63 | 1 | Matthew Sears | <pre> |
64 | 25 | Camdon Cady | RAILS_ENV=development rake db:migrate |
65 | 1 | Matthew Sears | </pre> |
66 | 1 | Matthew Sears | |
67 | 18 | Jeremy Wright | and for the plugins: |
68 | 18 | Jeremy Wright | |
69 | 18 | Jeremy Wright | <pre> |
70 | 25 | Camdon Cady | RAILS_ENV=development rake db:migrate_plugins |
71 | 18 | Jeremy Wright | </pre> |
72 | 1 | Matthew Sears | |
73 | 1 | Matthew Sears | We now need some seed data to get started: |
74 | 1 | Matthew Sears | |
75 | 1 | Matthew Sears | <pre> |
76 | 25 | Camdon Cady | RAILS_ENV=development rake db:seed |
77 | 1 | Matthew Sears | </pre> |
78 | 1 | Matthew Sears | |
79 | 1 | Matthew Sears | h1. Running the Application |
80 | 1 | Matthew Sears | |
81 | 1 | Matthew Sears | Now we should be ready to run the application locally: |
82 | 1 | Matthew Sears | |
83 | 1 | Matthew Sears | <pre> |
84 | 25 | Camdon Cady | RAILS_ENV=development script/server |
85 | 1 | Matthew Sears | </pre> |
86 | 1 | Matthew Sears | |
87 | 1 | Matthew Sears | If all goes well, you should be able to open the application at http://localhost:3000 |