Install Redmine on Windows


Be careful, these commands are valid for MySQL environment. Other DBMS (PostgreSQL, SQLServer) could have quite different syntax. See redmine documents for details.
We assume that you have already installed a MySQL environment that is up and running.

Get and configure redmine application

Get Redmine source code from here, and put it (if you got archive, extract it) into the directory you choosed (e.g. under directory ‘C:\My_Redmine’).
Now create an empty database and accompanying user:

CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER ‘redmine’@’localhost’ IDENTIFIED BY ‘my_password’;
GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’;

In this example we are creating a database named ‘redmine’ and an user identified by the username ‘redmine’ and the password ‘my_password’. Feel free to change these values according to your needs.
For MySQL < 5.0.2 use instead:

CREATE DATABASE redmine CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’ IDENTIFIED BY ‘my_password’;

Go to ‘My_Redmine’ directory and copy ‘config/database.yml.example’ to ‘config/database.yml’; edit this file in order to configure database settings for your environments.
For example:

production:
   adapter: mysql2
   database: redmine
   host: localhost
   username: redmine
   password: my_password

If your server is not running on the standard port (3306) or if you set different values for database’s name and user, change these settings to the right ones (to change the port add the line port:<port number>, e.g. port:3307).

Dependencies installation

Download “rubyinstaller-2.3.3” from here.
Run the executable and choose the installation directory, for example “C:\Ruby23”. During setup, select “Add Ruby executables to your PATH”.

Now, from the same webpage, download and run the development kit executable (something like “DevKit-mingw64-*-sfx.exe); during setup choose the installation dir, for example “C:\DevKit”.

Now open a command prompt and type:

cd C:\Ruby23\bin
ruby ..\DevKit\dk.rb init

Output should be something like:
[INFO] found RubyInstaller v2.3.3 at C:/Ruby23
Initialization complete! Please review and modify the auto-generated
‘config.yml’ file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

Now type:

ruby ..\DevKit\dk.rb install

Output should be something like:
[INFO] Updating convenience notice gem override for ‘C:/Ruby23’
[INFO] Installing ‘C:/Ruby23/lib/ruby/site_ruby/devkit.rb’

Now type:

gem install rails -v=4.2.8
gem install bundler
cd C:\My_Redmine
..\Ruby23\bin\bundle install –without rmagick

Rails version could be different.

WARNING. In this case system will be installed without development and test environments and rmagick (pdf and png manipulation library) dependency. You can choose to include them (to use rmagick you have to install its gem before bundle install)

Session store secret generation

Now create a random key typing:

..\Ruby23\bin\bundle exec rake generate_secret_token

Random key is used by rails to encode sessions.

Database schema objects creation

To create the database structure write:

set RAILS_ENV=production
..\Ruby23\bin\bundle exec rake db:migrate

Test application

Test the installation by typing:

..\Ruby23\bin\bundle exec rails server webrick -e production

This command run a webrick web server, available on “http://localhost:3000/”. Default login username-password is “admin”-“admin”.

DONE!

Redmine start and run depends on your system (e.g. it’s under an apache/nginx webserver, it’s standalone, etc.). To setup and run redmine as windows service, please look at this.

Leave a comment

Your email address will not be published. Required fields are marked *