1 Minute Guide – Installing Redmine on Windows

Redmine is a fantastic Issue Tracking (defects and enhancements) web application written in Ruby on Rails. I’ve been using it for quite a while, and it’s a good looking, simple but powerful defect management tool with a bunch of value-add features like document repositories, wikis, roadmap and time tracking.

Rails apps can be a bit mysterious to deploy on Windows server’s however, so here is a 1 minute guide to installing Redmine on Ruby on Rails on Windows! :)

You will need an Internet connected Windows PC or server to get started. If you don’t have an Internet-enabled PC, you can do the install on an Internet connected PC and move the Ruby folder tree to your target machine, but I’ll assume you live in the 21st century and do have Internet connectivity.

  1. Download version 1.8 of Ruby – the link is to the “all-in-one” installer for Windows. You need version 1.8, not 1.9 as Redmine only works on 1.8 right now.
  2. Set up so Ruby’s “bin” folder is in your system or command prompt path. You should be able to type “ruby” at the command prompt and not get any “file not found” errors.
  3. Create yourself some sort of “Ruby apps” folder and open a command prompt at that location, e.g. C:\Ruby\Apps or something
  4. At the command prompt: “gem install rails
  5. At the command prompt: “gem install mongrel
  6. Download the latest stable version of Redmine and unzip into a subfolder of your Ruby apps dir (e.g. C:\Ruby\Apps\Redmine)
  7. Configure the database.yml for Redmine to point to a database for your Redmine instance to use (I’ll leave that up to you)
  8. In the Redmine folder, at the command prompt: “rake db:migrate
  9. If you’re using Redmine v0.8.7 or above, at the command prompt: “rake generate_session_store”
  10. Test your Redmine installation is working, at the command prompt: “mongrel_rails start“, then hit http://localhost:[port]/ in your browser where [port] is the port Mongrel started with. Kill the server with Ctrl+C once you’ve verified Redmine is working.
  11. At the command prompt: “gem install win32-service
  12. At the command prompt: “gem install mongrel_service
  13. Install Redmine as a Windows service, at the command prompt: “mongrel_rails service::install -N Redmine -c [your redmine folder] -p [portno] -e production“, replacing [your redmine folder] with the full path to the Redmine folder in the filesystem, and the [portno] being the port you’d like redmine to server on, e.g. 80 for standard http port 80.

If at any time you wish to remove the Redmine windows service (uninstall), you can enter “mongrel_rails service::remove -N Redmine” at the command prompt to remove it.

If you get an error at any one of the steps above, well, you’re going to have to go hit up Google for some solutions. But from a fresh install the above should work just fine – happy mining…

Related posts:

  1. Setting Up Memcached As A Windows Service
  2. 5 Minute Guide to Clustering – Java Web Apps in Tomcat

This entry was posted in Software Engineering and tagged guides, open-source, rails, redmine, ruby, windows. Bookmark the permalink.

28 Responses to 1 Minute Guide – Installing Redmine on Windows

  1. Collin Sauve says:

    Great info, but I think you have a couple typos;

    1. step 11 should be an underscore rather than hyphen. replace “gem install mongrel-service” with “gem install mongrel_service”

    2. step 12 has two colons between service and install. replace “mongrel_rails service::install” with “mongrel_rails service:install”

    3. step to remove also has two colons.

    also, i believe step 8 rake db:migrate should specify production, as well as step 9 mogrel_rails start should specify production.

  2. Collin Sauve says:

    oops.. ignore my #2 and #3 you actually do need the double colon. but I believe my number 1 and the note about productin still stand.

  3. rn says:

    Thanks for the heads-up… fixed :)

  4. yulia says:

    i have a problem, please help
    at step 8 i keep getting:

    C:\Ruby\apps\redmine-0.8.5>rake db:migrate
    (in C:/Ruby/apps/redmine-0.8.5)
    rake aborted!
    #42000Unknown database ‘redmine_development’

    (See full trace by running task with –trace)

  5. Mathieu says:

    Hi Julia,

    You have to create a database called redmine, another one called redmine_development and redmine_test.

    :)

  6. possum says:

    @yulia

    …u need to create a mysql database named redmine_development.

  7. Adrian says:

    Hi thanks for the tutorial.
    Some minor changes to note:
    If you get the 0.8.4 version of Redmine you will need “gem install -v=2.1.2 rails” instead of latest rails version.
    Instead of “rake db:migrate” use “rake db:migrate RAILS_ENV=production” to create the production database only and avoid the redmine_development error.
    So far those are the only changes I needed.

    Thanks again,

    Lic. Adrián P. Eidelman
    Director – BlueSoft, tecnología de vanguardia para su empresa

  8. Adrian says:

    One more small change:
    In step 9 use “mongrel_rails start -e production” if you only created the production database.

    Regards,

    Lic. Adrián P. Eidelman
    Director – BlueSoft, tecnología de vanguardia para su empresa

  9. Dr.Luiji says:

    The step 4 give me this error during the install:
    – ERROR: Failed to build gem native extension.

    So far, after investigating a bit I’ve found the cure, it’s needed a ruby gems update, at the command prompt digit:
    “gem update –system“
    At the end of the update Rubygems retry the step 4:
    “gem install rails“

    Now You can goahead with the others steps.
    Cheers.

  10. Ajay SOni says:

    Hi
    During the step no 4, while running “gem install rails” command, I am getting following error message:
    “ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
    getaddrinfo: no address associated with hostname.(SocketError)”

    Please Help

    Regards
    Ajay

  11. rn says:

    Sounds like you have an internet connectivity problem.

  12. Steph says:

    Hi,
    during the step no 8, at the command prompt: “rake db:migrate RAILS_ENV=production“ I am getting following error message
    “c:\Ruby\Apps\redmine>rake db:migrate RAILS_ENV=
    (in c:/Ruby/Apps/redmine)
    rake aborted!
    adapter:mysql database:redmine host:localhost:3
    oding:utf8 database is not configured

    (See full trace by running task with –trace)

    I have Ruby 1.8.6-p383 (RC1)
    and redmine-0.8 version stable

    Please help

  13. Ben Farmer says:

    Thanks for the guide! One small correction to it, on version 0.8.7, you need to run “rake generate_session_store” after step 8. That will correct the “A key is required to write a cookie containing the session data” error.

    Excellent guide!

  14. Poobalan says:

    Wonderful tutorial Richard Nichols. And also i need to know how to migrate existing db to newly installed redmine.
    As far as i know,
    step 1: rake redmine:migrate_from_trac RAILS _ENV=”production”
    step 2: It asks for the physical directory “ie:.trac directory”. when i enters the path it shows “no attachments”

    Do i need to install some trac environment?

    check out this video in youtube.
    http://www.youtube.com/watch?v=ethtaYKdl9g

  15. Tom says:

    I get this error when I try to do either of the commands(gem install rails, gem install mongrel):
    for “gem install rails”:
    ERROR: While executing gem …
    Could not find rails 0> in any repository

    for “gem install mongrel”:
    ERROR: While executing gem …
    Could not find mongrel 0> in any repository

    How can I fix this?

  16. rn says:

    My guess is that you have a dodgy ruby installation. Try reinstalling from scratch. I’ve seen similar errors when using the Ruby bundled with “InstantRails” – did you use a fresh install?

  17. Amy says:

    The step 4 give me this error during the install:
    – ERROR: Failed to build gem native extension.

    So far, after investigating a bit I’ve found the cure, it’s needed a ruby gems update, at the command prompt digit:
    “gem update –system“
    At the end of the update Rubygems retry the step 4:
    “gem install rails“

    Now You can goahead with the others steps.
    Cheers.

  18. Ahmet says:

    If you get error:
    “error installing win32-service
    ‘make’ is not recognized as an internal or external command,
    operable program or batch file.

    at step 11 then try to use that command instead

    gem install win32-service –platform=mswin32

  19. Robin McKenzie says:

    Thanks for the tutorial – very clear and concise!

    I’m trying to get whatever web server is installed as part of Redmine (is it Apache?) to serve CSV files as mime type of “text/csv” – can you point me in the direction of where the configuration file lives please?

    Thanks.

  20. @Robin

    I don’t think it’s a Mongrel (the web server configured above) issue – I think it depends on what mime type that Redmine has stored for your attachment. If the exported Redmine CSV’s are not correctly identified as text/csv, it may be a bug in Redmine. I’d suggest heading over to http://redmine.org and asking there.

  21. korpella says:

    Hi, help , am getting this when i try to migrate

    rake aborted!
    No such file or directory – C:/Ruby/Apps/Redmine/config/database.yml

    (See full trace by running task with –trace)

    then how do i Configure the database.yml for Redmine to point to a database for your Redmine instance to use

    regards

  22. You need to configure your database in the C:/Ruby/Apps/Redmine/config/database.yml file. Check that the file exists and you’ve edited it with your database settings.
    If that doesn’t work, run rake with the -trace option to get more information about where it’s failing.

  23. jack says:

    Hi, when i run my http:\\localhost:3000 it works well and redmine loads

    However, if i close the ruby command line interface , i am not able to access the http:\\localhost:3000 and see redmine.

    is there a problem? is this the way it should be? whats the issue sir?

    regards

  24. steps 11-13 install Redmine as a Windows Service.
    Running from the ruby command line is just to test the rest of your configuration is working.
    Once you’ve done that, do steps 11-13 and then start the service from the Windows Service Panel. (services.msc)

  25. korpella says:

    thanks alot Richard…

    rake aborted!
    syntax error on line 19, col 1: ` development:’

    (See full trace by running task with –trace)

    i am getting this problem when i try to migrate
    Help

    whats the issue sir?

  26. My guess is that your database.yml file is not formatted correctly, i.e. you invalidated the file somehow when you changed the database config.
    Maybe start over with a fresh one and make your settings again.

  27. Michael says:

    I was following the instructions on this tutorial and all was going well till the last step. When I try to run the command from the directory

    E:\Ruby187\apps\Redmine>mongrel_rails service::install –N Redmine –p 8181 –e production
    I get the following error

    ERROR RUNNING ‘service::install’: Plugin /service::install does not exist in cat
    egory /commands
    Use help command to get help

    I have searched online and could not find an answer please let me know if you know what the issue is so we can test this SW out.
    Thanks

    Buzz

  28. MountainWhale says:

    My install would not work on MS Server 2008

    I was getting this error:
    C:\Ruby\Apps\Redmine>gem install win32-service -platform=mswin32
    Building native extensions. This could take a while…
    ERROR: Error installing win32-service:
    ERROR: Failed to build gem native extension.

    C:/Ruby/bin/ruby.exe extconf.rb
    checking for RegisterServiceCtrlHandlerEx()… no
    creating Makefile

    make
    ‘make’ is not recognized as an internal or external command,
    operable program or batch file.

    Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/win32-service-
    0.7.1 for inspection.
    Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-service-0.7.1/ext/gem_mak
    e.out
    ERROR: Could not find a valid gem ‘ûplatform=mswin32′ (>= 0) in any repository

    Find the solution here: http://www.ruby-forum.com/topic/191948

    Run this at the command prompt: (you only have to do this once)
    gem sources -a http://gems.github.com –platform=mswin32

    Then run:
    gem install win32-service –platform=mswin32

    This worked for the mongrel service install as well.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>