Note: Dedomenon doesn’t run fine with the gem ruby-pg!
This guide will help you in installing Dedomenon on your machine. However note that this installation guide is heavily geared towards Debian systems (like Ubuntu etc.)
The process is divided into logical steps.
- Postgresql: Install using:
$ sudo apt-get install postgresql
- Rake: Install using:
$ sudo gem install rake
- Openssl: Install using:
$ sudo apt-get install libopenssl-ruby
Step1: Install packages
- Make sure you have sudo installed:
apt-get install sudo
If you’re on debian, configure it so that you can execute the createdb and createuser commands as postgres. This is done by executing the command
and adding this line to the file:
YOURLOGIN ALL=(postgres) NOPASSWD:/usr/bin/psql, /usr/bin/createdb, /usr/bin/createuser
- Install packages with this command:
$ sudo aptitude install ruby1.8 ruby1.8-dev irb rake rubygems build-essential \ postgresql-8.2 postgresql-contrib-8.2 libpgsql-ruby1.8 libz-dev libpng-dev libgd2-xpm-dev bit-core
Note for Debian:
postgresql-8.2 package is not available as now. replace
8.1 for all the
postgresql packages in this command
Step2: Install Gems
- Now you need to install some gems:
$ sudo gem install ruby-debug json captcha ruby-gd sources termios
Install highest available version of each gem.
Step Optional: Change postgres user password (OPTIONAL)
You do not need to do this step if you’ve done it already or do not want to change the password.
- Log on to the freshly install database server by:
$ sudo -u postgres psql postgres
- Change the password of the default user on prompt with:
postgres# ALTER USER postgres WITH ENCRYPTED PASSWORD 'my_password';
- then quit with
Step3: Get the application
- Get the application from git:
$ git clone git://dedomenon.org/dedomenon
After getting the source on your local file system, you need to copy the system wide settings file for configuration:
$ cd dedomenon $ cp config/settings.yml.sample settings.yml.sample
After copying the file to settings.yml, you may want to have a look at the file contents and make changes in accordance. Though making changes is not needed if you’re only installing Dedomenon on a local machine for testing purposes.
Step 4: Run Dedomenon Setup
On root of the application, execute this rake task:
$ rake dedomenon:setup # Creates users, databases, loads translations.
This might ask for your super user passwords as these are executed as super user. The setup has created two users for you:
- myowndb: is the normal user used for production and development environments
- myowndbtester is a super user used for test environemnts
Setup also created four databases for you:
- myowndb_dev: to be used for development environment
- myowndb_test: to be used for test environment
- myowndb_production: to be used for production environment
- myowndb_ui_translations: for translations of the interface.
Setup also ran migrations on production database for you. But if you want to run application in test or development modes, you will have to run migrations yourself like this:
- RAILS_ENV=development rake db:migrate
- RAILS_ENV=test rake db:migrate
Setup has also generated a file config/database.yml containing correct connection information and passwords you supplied for users during setup. If you want to revert, execute rake dedomenon:purge and it will delete all the users and databases.
Step 5: Run the application
- From root of the application do this
$ ruby script/server --environment=production
- Now you can browse your application at http://localhost:3000/app
Step Optional: Run the tests
- From root of the application run unit tests
$ rake test:units
- And also run functional tests:
$ rake test:functionals
- However note that if you run functional tests through rake, the tests under test/functional/entities_controller.rb would always fail. Its a known bug in rails loading of classes which is yet not investigated.