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.
- 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.
- 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.
- Create yourself some sort of “Ruby apps” folder and open a command prompt at that location, e.g. C:\Ruby\Apps or something
- At the command prompt: “gem install rails“
- At the command prompt: “gem install mongrel“
- Download the latest stable version of Redmine and unzip into a subfolder of your Ruby apps dir (e.g. C:\Ruby\Apps\Redmine)
- Configure the database.yml for Redmine to point to a database for your Redmine instance to use (I’ll leave that up to you)
- In the Redmine folder, at the command prompt: “rake db:migrate“
- If you’re using Redmine v0.8.7 or above, at the command prompt: “rake generate_session_store”
- 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.
- At the command prompt: “gem install win32-service“
- At the command prompt: “gem install mongrel_service“
- 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 by Collin Sauve on September 26th, 2009
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 by Collin Sauve on September 26th, 2009
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 by rn on September 28th, 2009
Thanks for the heads-up… fixed
#4 by yulia on October 4th, 2009
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 by Mathieu on October 8th, 2009
Hi Julia,
You have to create a database called redmine, another one called redmine_development and redmine_test.
#6 by possum on October 10th, 2009
@yulia
…u need to create a mysql database named redmine_development.
#7 by Adrian on October 20th, 2009
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 by Adrian on October 20th, 2009
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 by Dr.Luiji on October 28th, 2009
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 by Ajay SOni on December 3rd, 2009
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 by rn on December 9th, 2009
Sounds like you have an internet connectivity problem.
#12 by Steph on December 23rd, 2009
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 by Ben Farmer on January 19th, 2010
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 by Poobalan on February 18th, 2010
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 by Tom on February 26th, 2010
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 by rn on February 26th, 2010
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?