You are here:Home»KB»Programming»General»Redmine»Install Redmine on Windows
Saturday, 17 January 2015 15:47

Install Redmine on Windows

Written by

There are 2 different methods to install Redmine on windows and each has their benefits

  Bitnami Redmine StackSeperate Services: Redmine, Edge Subversion and Xampp
Comparison of Redmine Installation Methods
Pros
  • free
  • the install package installs all require assests
  • you can change the different service port numbers
  • redmine is already configured to the defferent services ie subversion
  • easy to install
  • takes abbout 45 mins to install witha few clicks
  • you can selectively install the various different components
    • subversion
    • DevKit
    • PhpMyadmin
    • Redmine
    • Git
  • all services are install as 'Windows Services'
  • free
  • can use ViewVC as an independant difference viewer
  • subversion Edge has an update feature
  • can use other ruby apps in the same install
  • easier to manage subversion with the Webbased Admin panel in Edge Subversion
  • Subversion Edge has a REST API which is good for future 3rd party development
  • Subversion Edge installs its own SSL certificate for SSL communications
Cons
  • upgrading is not a streamlined process
  • control panel has limited functionality meaning you have to edit config settings by hand
  • subversion is via command line only
  • advanced repository refresh via repository hook is not configured
  • singulary focused to running redmine
  • automatic repository does is not configured
  • takes 2+ hours to install
  • some technical knowledge is required
  • you have to manually configure Remine to run as a service

Bitnami Redmine Stack

This by far the easiet method of installing Redmine with subversion integration. You literally only need to click install, select your install location (i would recommend without spaces to be on the safe side), run the installer and then make sure you are happy with the port numbers. Done.

Upgrading the Binami Stack is possible and there are instructions but do require a little bit of planning and as always make sure you have a backup first.

Bitnami also does a Virtual Machine already configured using Linux that will work on all flavours of VMWare and Virtualbox. The homepage is here

Installation Guide For installing Redmine on Windows with Xampp

I searched the internet and did not find that many instructions on how to install Redmine on windows which i found strange. Most of the instructions were complicated and assumed you already had knowledge on how to install Redmine. eventually i cam across the instructions from NBL Creations, but alas, they did not work either. These instructions were set set out in a very straight forward mannor and were writtin in 2010, so i assumed they were correct then but things have changed since then. I proceeded to go through the instructions from NLB and as i cam across issues i found a solutions. This is basically (for now) how my instructions have beend laid out. Where there are issues with the step i have made clear notes on what to do. This is a very easy installation and gives you the benefits of a Xammp installtion with such things as PhpMyadmin.

This is my prefered method of installing Redmine because i can use the installed Ruby services for other development, i get the added benefits of the CollabNet Subversion Edge Server featuers including ViewVC which is an excellent difference viewer. The server identifications are easily changed in the webbased admin which is great when you are playing with the settings to see what you want. It does have its downside that it requires a lot more configuration. It is not all bad becaus ei will also use the xampp server for developing my apps that require a webserver to run.

I would recommend that you read the instructions through once before starting as this process can be quite lenghty.

Software Versions Used

  • Rails Installer 3.1.0 (it is 32bit) (ruby version 2.1.5)
  • ImageMagick-6.7.9-9-Q16-windows-dll.exe (this is 32bit)
  • Redmine 2.6.1
  • mysql-connector-c-noinstall-6.0.2-win32

My Folder Locations I have used (might not be the same in the original instructions)

  • Xampp - D:\Documents\Developer\xampp
  • Railsinstaller - D:\Documents\Developer\Railsinstaller
  • Redmine - D:\Documents\Developer\RubyRoot\redmine
  • Mysql connector - D:\Documents\Developer\Railsinstaller\MySQL
  • Image Magick - D:\Documents\Developer\ImageMagick

Instructions Begin Here

Instructions based on this article - Installing Ruby on Rails and Redmine with XAMPP on Windows 7 - NLB Creations NLB Creations

This takes 2:00hrs to install

  • These instructions assume that you are running an Xampp webserver on you computer.
  • The mysql service needs to be running for Redmine to come up and work
  • do not use spaces in your path to redmine and xampp. There might be ways around this but is not covered here.

I like Xampp. It sets up a full Apache/MySQL/PHP development environment with very little hassle, which means it’s installed on just about every computer I use on a regular basis. I recently had a need to look into Ruby on Rails (specifically so that I could use the Redmine project management web app) and figured it would be easy to integrate it into my existing dev environment.

It kind of… wasn’t.

This is how I finally managed (after two days of ripping my hair out) to do it.

1) Download and install XAMPP.

2) Download RailsInstaller for Windows.

3) Install RailsInstaller to the D:\Documents\Developer\RailsInstaller directory.

- check ‘Install Git (recommended)
- check “Add executables for Ruby, DevKit and Git (if checked above) to the PATH”

– Check “Configure git and ssh when installation has completed” at the end of the install.
– Enter the requested info in the Rails Environment Configuration screen.

- the git thing ask you for your name and email for something to do with GIT / GIT hub. i dont know why you need these, but creates a file in C:\Users\{username}\.gitconfig with these details
- this seems part of the Ruby setup
- if you already have Git information set in the file above, the setup will use that
- restart PC after installing Rails installer (might not be needed)

4) Create a new Ruby on Rails project:

a) Open a cmd window
b) Type: rails new D:/Documents/Developer/RubyRoot/redmine/

- this copies the rails scaffolding/template files into the specified directory.
- Installation might fail because of SSL issues and that files are downloaded on request by this software. There is an updated SSL certificate that was not put in some versions of Ruby. The solution is to manually download the new SSL cert and place in the correct folder before running this command.
ruby on rails - Can't access RubyGems - possibly due to SSL? - Stack Overflow
Download: AddTrustExternalCARoot-2048.pem
put it in the folder - D:\Documents\Developer\RailsInstaller\Ruby2.1.0\lib\ruby\2.1.0\rubygems\ssl_certs
- you might be prompted with
<config/secrets.yml? (enter "h" for help) [Ynaqdh] - i entered 'Y'

5) Add the following to the end of the D:\Documents\Developer\xampp\config\httpd.conf file:
- i could not get this to forward redmine to xampp/apache

# Listen 3000
# LoadModule rewrite_module modules/mod_rewrite.so
#################################
# RUBY SETUP
#################################
<VirtualHost *:3000>

ServerName rails
DocumentRoot "D:/Documents/Developer/RubyRoot/redmine/public/"

<Directory "D:/Documents/Developer/RubyRoot/redmine/">
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
</Directory>

</VirtualHost>
#################################
# RUBY SETUP
#################################

Side Note: Make sure you try to start/restart Apache from the Xampp control panel after you save the httpd.conf file. If Apache won’t run, try removing the “Listen 3000″ line.

- Just comment out (as in my version) Listen 3000 and LoadModule rewrite_module modules/mod_rewrite.so because if you have apache running on port 3000 the ruby server cannot start and LoadModule rewrite_module modules/mod_rewrite.so is already uncommented in http.conf so is pointless. Might be worth a quick check.
- you need to add 'rails 127.0.0.1' in to your host file
- i also think that <VirtualHost *:3000> should be <VirtualHost *:80> / <VirtualHost *> / <VirtualHost *:81> or whatever your prot number is
- i can't get this to work, it does not seem to do anything except make the http://rails/ domain valid on 127.0.0.1 and this xampp install

- I don’t know if this is needed to be done for httpd-ssl.conf (if you want SSL)

6) Back in the cmd window, navigate to the directory of your project and start the Rails server with the following commands:

cd D:/Documents/Developer/RubyRoot/redmine

          rails server

         - can take a moment to start. The batch file will display information when started

7) In your browser, navigate to http://localhost:3000 where you should see the RoR welcome screen. Once you’ve verified RoR is working, Ctrl-C in the cmd window to shut down the server.

- rails server stops working when you disable the command prompt window

8) Download Redmine and extract the .zip file. Replace the files generated in D:\Documents\Developer\RubyRoot\redmine\ with the files from the .zip file replacing any files when prompted

9) Create your Redmine database. Start Apache and MySql from the Xampp control panel, and in your browser, go to http://localhost/phpmyadmin to access the MySQL interface.

Click the SQL tab and run the following:
create database redmine character set utf8;
create user 'redmineUser'@'localhost' identified by 'myPassword';
grant all privileges on redmine.* to 'redmineUser'@'localhost';

10) Configure Redmine in the redmine/conf/database.yml file by adding your newly created database, username, and password in the appropriate locations.

- the /conf/ folder is now /config/ to redmine/config/database.yml

it should only contain the following

production:
adapter: mysql2
database: redmine
host: localhost
username: root
password: ""
encoding: utf8

- if like me you are running MySQL on another port you also need to add another setting
Info from here - Redmine Wiki - Redmine Install

production:
adapter: mysql2
database: redmine
host: localhost
port: 3307
username: root
password: ""
encoding: utf8


11) In the cmd window, make sure you are still in your Redmine project’s directory, and run the following command:

bundle install

- my install ‘failed’ here and actually failed quite quickly
- I got the error

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
You have requested:
i18n ~> 0.6.11
The bundle currently has i18n locked at 0.7.0.
Try running `bundle update i18n`

- So I typed ‘bundle update i18n’
- I then got the error

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundler could not find compatible versions for gem "actionpack":
In snapshot (Gemfile.lock):
actionpack (4.1.8)
In Gemfile:
rails (= 3.2.21) x86-mingw32 depends on
actionpack (= 3.2.21) x86-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

- I then typed ‘bundle update’


12) In all likelihood, it will fail epically when it gets to the rmagick gem (if not, lucky you). Go to http://rubyforge.org/projects/rmagick/ and download the file called rmagick-win32.

a) Install the Ruby Installer DevKit: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

- the devkit is part of the Railsinstaller so does not need to be downloaded
D:\Documents\Developer\RailsInstaller\DevKit
proceed to next step (b) if DevKit is Present

the configured config.yml contains the following line only: (keep the dash)
          - D:/Documents/Developer/RailsInstaller/Ruby2.1.0

- RubyGems.org Replaces RubyForge as Gem Host - tells you to download gems on RubyGems.org
-
HowTo install rmagick gem on Windows - Redmine - this tells of which check boxes to tick
-
Installing on Windows · rmagick/rmagick Wiki · GitHub - another rmagik install on windows article and tells the maximum version that works is 6.7.9.9
-
Installing RMagick on Windows 7 | Coding with Bunnies - excellent article
- http://rubyinstaller.org/downloads/ - download the devkit here
- if the configuration file will not auto generate you can just edit it manually (see above for setting).
- the configuration file is autogenerated when the command ruby dk.rb init
-
Can't get Ruby DevKit configuration file autogenerated properly - Stack Overflow
-
Ruby on rails devkit windows - Stack Overflow
-
Install Ruby DevKit on Windows 7
-
Install Ruby and the Ruby DevKit
- the dev kit needs to match the x32 or x64 of ruby - run 'ruby - v' to see what version

- ruby.rb init - this finds ruby installs and edits the config.yml , this does not always work. if this does not work you need to manuall add the entry
note the dash, it is important, installation of the devkit means, just extract it somewhere
       - D:\Documents\Developer\Ruby\DevKit

- if for some reason you need to manuall install the Devkit, when you extract the devkit to the specified folder, you must not change that folder or name. the 7zip has magic in it and hardcodes the install directory

 

b) Download Imagemagick (check the box to install headers in the installer) : http://www.imagemagick.org/script/binary-releases.php#windows

- make sure that the following are both checked.
“Add Application directory to your system path”
“Install development headers and libraries for C and C++”


- download only the 32-Bit version, installs with x64 will not compile, it will give errors
- the latest version of ImageMagick that will work with rails is 6.7.9.9
- I don’t know the difference netween static or dynamic
- the exact file that I used and worked is
ImageMagick-6.7.9-9-Q16-windows-dll.exe
- if 6.7.9.9 will not work another recommendation is 6.7.9.9
- you can get old binaries here:
ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/ImageMagick-6.7.9-9-Q16-windows-x64-dll.exe

c) Install ImageMagick to a location that does NOT contain any spaces in the directory names (like C:\ImageMagick)

- I did D:\Documents\Developer\ImageMagick

d) In the cmd window, run the following:

gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include

- is this process creating a GEM (possibly this is compiling the code)
- when installing make sure the 3 following items are checked
- I did gem install rmagick --platform=ruby -- --with-opt-lib=d:/Documents/Developer/ImageMagick/lib --with-opt-include=d:/Documents/Developer/ImageMagick/include

e) Wait. This seems to take an ungodly amount of time, for some reason.

- about 10 – 15 mins on new PC
- it will finish with a “1 gem installed” message

13) Run “bundle install” again.

- my install failed here and actually failed quite quickly
- I got the error

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
You have requested:
i18n ~> 0.6.11
The bundle currently has i18n locked at 0.7.0.
Try running `bundle update i18n`

- So I typed ‘bundle update i18n’
- I then got the error

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundler could not find compatible versions for gem "actionpack":
In snapshot (Gemfile.lock):
actionpack (4.1.8)
In Gemfile:
rails (= 3.2.21) x86-mingw32 depends on
actionpack (= 3.2.21) x86-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

- I then typed ‘bundle update’
- I then get the error:

Gem files will remain installed in D:/Documents/Developer/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/mysql2-0.3.17 for inspection.
Results logged to D:/Documents/Developer/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/mysql2-0.3.17/gem_make.out
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling.

14) Manually install the mysql2 gem. For some reason, bundle install doesn’t know how to do this right on Windows.

    1. Download MySQL Connector from mysql.com
    2. Extract the .zip file to D:\Documents\Developer\Railsinstaller\MySQL
    3. Run the following in the cmd window:

      - this command does not work
      gem install mysql2 -- '--with-mysql-lib="D:/Documents/Developer/RailsInstaller/mysql/bin" --with-mysql-include="D:/Documents/Developer/RailsInstaller/mysql/include"'

      - I get the following error
      Gem files will remain installed in D:/Documents/Developer/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/mysql2-0.3.17 for inspection.
      Results logged to D:/Documents/Developer/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/mysql2-0.3.17/gem_make.out

      - I get this error because the command is wrong. You should use the following command and run it from the redmine project directory
      gem install mysql2 --no-ri --no-rdoc -- --with-mysql-dir=D:\Documents\Developer\RailsInstaller\MySQL

      watch this video(mysql connector)
      How to install Ruby on Rails on Windows 7 - Part 3, MySQL connector - YouTube

      - use this file
      mysql-connector-c-noinstall-6.0.2-win32.zip
      Windows (x86, 32-bit), ZIP Archive
      from - http://dev.mysql.com/downloads/connector/c/
    4. Copy libmysql.dll from D:\Documents\Developer\RailsInstaller\mysql\lib to D:\Documents\Developer\RailsInstaller\Ruby2.1.0\bin

15) In the cmd window, execute the following commands:

Make sure that your MySQL server is running before continuing

set RAILS_ENV=production
rake generate_secret_token
rake db:migrate
rake redmine:load_default_data

* That last line is optional. It installs the demo data

- after I run rake generate_secret_token I get an error:
Could not find gem 'selenium-webdriver (>= 0) x86-mingw32' in the gems available on this machine.
Run `bundle install` to install missing gems.

- so I ran ‘bundle install’
- then ‘bundle update i18n’
- then bundle update (perhaps I should of run this in the beginning)

- then re-run rake generate_secret_token
if you still get error messages after successfully installing the the MySQL Connector then you should make sure you have copied the libmysql.dll file to the correct directory and then reboot your computer before continuing.

- back to
rake db:migrate (this correctely creates the tables)

 

16) Start the rails server. In the cmd window, navigate to D:\Documents\Developer\RubyRoot\redmine and execute the following:

rails server

17) In your browser, navigate to http://localhost:3000 where you should now see the Redmine homepage.

18) If you’re still sane, enjoy your new Redmine install.

** It’s also worth noting that Redmine won’t actually be RUNNING on XAMPP’s Apache server. It will be running on the Rails server. This just makes it play nice with a new or existing XAMPP install.

    • I need to get redmine to run through apache via the virtual host as it does not work
    • A section – get redmine to run as service automatically
    • A section – configure redmine
    • A section – integrate redmine with subversion ie create repositories and hooks etc.. (can use bitnami for help with files as it is already integrated in the package)

Post Redmine Installation

Once you have completed your Redmine installation there are a few things you might come across or need to do.

 

General Installation Links

Gems

Gems are like plugins for ruby and like a lot of linux systems are downloaded from the internet upon demand rather than being present in your system from the start.

A useful thing is that you can get the different version/revision names from https://rubygems.org/ . If you search this site for your Gem it will give yoou all the previous revisions and actually gives you the install command for that particular version.

Example: gem install win32-service -v 0.8.5
From:
https://rubygems.org/gems/win32-service

A good article on Gems, Installing and Uninstalling, RubyMine 7.0.2 Web Help

Installing and uninstalling Gems

This process is failry easy.

To install a gem

Gem uninstall <gem_name>

You can install specific version fof a gem and this can be handy whent here are incompatabilities between vearious gems and software in your install.

If you run the install command with no version number, the latest version of the gem will be installed.

To uninstall a gem

Gem uninstall <gem_name>

When you run uninstall a gem with this command, if there are multiple versions of it, the uninstaller will give you the options of which one to uninstall or all of them.

Read 6632 times Last modified on Wednesday, 11 February 2015 21:12