Development Setup¶
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.
Prerequisites¶
- SVN
- MySQL (Currently tested with MySQL v5.1)
- Ruby 1.8.7 (with Development Tools)
- MySQL header files (i.e. package libmysqlclient-dev on Debian-based systems)
- Bundler (may need to update gem to 1.4+)
gem install bundler
- To update gem you may need to run (su to root):
REALLY_GEM_UPDATE_SYSTEM=1 gem update --system
- After this update you'll need to reinstall bundler.
- To update gem you may need to run (su to root):
- Install Rake v.0.8.7
gem install rake -v 0.8.7
- Install Ruby on Rails (Currently tested with Rails v2.3.16)
gem install rails -v 2.3.16
Code checkout¶
To get started, create a local repository with svn checkout:
svn checkout https://opendesignengine.net/svn/ode/trunk
Create Development Database¶
You will need to setup a local development MySQL database and call it 'ode_development'.
To create the database, run the following commands:
mysql -u root -p mysql> create database ode_development character set utf8; mysql> create user 'ode_development'@'localhost' identified by 'my_password'; mysql> grant all privileges on ode_development.* to 'ode_development'@'localhost'; mysql> exit
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:
cd trunk cp config/database.yml.example config/database.yml
Under the development: section of the the config file, fill in the database name, username, and password.
Bundler¶
To install the required third-party gems to run the ODE application, we run the following Bundler command:
bundle install
Database Preparation¶
To prepare the database, we first need to run migrations:
RAILS_ENV=development rake db:migrate
and for the plugins:
RAILS_ENV=development rake db:migrate_plugins
We now need some seed data to get started:
RAILS_ENV=development rake db:seed
Running the Application¶
Now we should be ready to run the application locally:
RAILS_ENV=development script/server
If all goes well, you should be able to open the application at http://localhost:3000