Installing Redmine on Windows for Newbie

C:\Users\ashwin kumar>cd C:\software\Ruby\rubygems-1.3.7
First Install Ruby Gems after Installing Ruby
C:\software\Ruby\rubygems-1.3.7>ruby setup.rb
RubyGems 1.3.7 installed
=== 1.3.7 / 2010-05-13
NOTE:
http://rubygems.org is now the default source for downloading gems.
You may have sources set via ~/.gemrc, so you should replace
http://gems.rubyforge.org with http://rubygems.org
http://gems.rubyforge.org will continue to work for the forseeable future.
New features:
* `gem` commands
* `gem install` and `gem fetch` now report alternate platforms when a
matching one couldn’t be found.
* `gem contents` –prefix is now the default as specified in –help. Bug
#27211 by Mamoru Tasaka.
* `gem fetch` can fetch of old versions again. Bug #27960 by Eric Hankins.
* `gem query` and friends output now lists platforms. Bug #27856 by Greg
Hazel.
* `gem server` now allows specification of multiple gem dirs for
documentation. Bug #27573 by Yuki Sonoda.
* `gem unpack` can unpack gems again. Bug #27872 by Timothy Jones.
* `gem unpack` now unpacks remote gems.
* –user-install is no longer the default. If you really liked it, see
Gem::ConfigFile to learn how to set it by default. (This change was made
in 1.3.6)
* RubyGems now has platform support for IronRuby. Patch #27951 by Will Green.
Bug fixes:
* Require rubygems/custom_require if –disable-gem was set. Bug #27700 by
Roger Pack.
* RubyGems now protects against exceptions being raised by plugins.
* rubygems/builder now requires user_interaction. Ruby Bug #1040 by Phillip
Toland.
* Gem::Dependency support #version_requirements= with a warning. Fix for old
Rails versions. Bug #27868 by Wei Jen Lu.
* Gem::PackageTask depends on the package dir like the other rake package
tasks so dependencies can be hooked up correctly.

——————————————————————————
RubyGems installed the following executables:
C:/setup/Ruby186/bin/gem
Fetch Rails Before Installing

C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem fetch rails -v=2.3.5
Downloaded rails-2.3.5
Install Rails Now

C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem install rails -v=2.3.5
Successfully installed rake-0.8.7
Successfully installed activesupport-2.3.5
Successfully installed activerecord-2.3.5
Successfully installed rack-1.0.1
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Successfully installed activeresource-2.3.5
Successfully installed rails-2.3.5
8 gems installed
Installing ri documentation for rake-0.8.7…
Installing ri documentation for activesupport-2.3.5…
Installing ri documentation for activerecord-2.3.5…
Installing ri documentation for rack-1.0.1…
Installing ri documentation for actionpack-2.3.5…
Installing ri documentation for actionmailer-2.3.5…
Installing ri documentation for activeresource-2.3.5…
Installing ri documentation for rails-2.3.5…
Installing RDoc documentation for rake-0.8.7…
Installing RDoc documentation for activesupport-2.3.5…
Installing RDoc documentation for activerecord-2.3.5…
Installing RDoc documentation for rack-1.0.1…
Installing RDoc documentation for actionpack-2.3.5…
Installing RDoc documentation for actionmailer-2.3.5…
Installing RDoc documentation for activeresource-2.3.5…
Installing RDoc documentation for rails-2.3.5…

Now Install Rack
C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem install rack -v=1.0.1
Successfully installed rack-1.0.1
1 gem installed
Installing ri documentation for rack-1.0.1…
Installing RDoc documentation for rack-1.0.1…

Generate Session Store
C:\software\ProjectManagement\Ruby\redmine-1.0.0>rake generate_session_store
(in C:/software/ProjectManagement/Ruby/redmine-1.0.0)

Now Set Rails Environment
C:\software\ProjectManagement\Ruby\redmine-1.0.0>set RAILS_ENV=production
Now run DB Migrate to setup Data
C:\software\ProjectManagement\Ruby\redmine-1.0.0>rake db:migrate
(in C:/software/ProjectManagement/Ruby/redmine-1.0.0)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load — mysql
(See full trace by running task with –trace)
Install MySql if you don’t have
C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem install mysql
Successfully installed mysql-2.8.1-x86-mingw32
1 gem installed
Installing ri documentation for mysql-2.8.1-x86-mingw32…
No definition for next_result
No definition for field_name
No definition for field_table
No definition for field_def
No definition for field_type
No definition for field_length
No definition for field_max_length
No definition for field_flags
No definition for field_decimals
No definition for time_inspect
No definition for time_to_s
No definition for time_get_year
No definition for time_get_month
No definition for time_get_day
No definition for time_get_hour
No definition for time_get_minute
No definition for time_get_second
No definition for time_get_neg
No definition for time_get_second_part
No definition for time_set_year
No definition for time_set_month
No definition for time_set_day
No definition for time_set_hour
No definition for time_set_minute
No definition for time_set_second
No definition for time_set_neg
No definition for time_set_second_part
No definition for time_equal
No definition for error_errno
No definition for error_sqlstate
Installing RDoc documentation for mysql-2.8.1-x86-mingw32…
No definition for next_result
No definition for field_name
No definition for field_table
No definition for field_def
No definition for field_type
No definition for field_length
No definition for field_max_length
No definition for field_flags
No definition for field_decimals
No definition for time_inspect
No definition for time_to_s
No definition for time_get_year
No definition for time_get_month
No definition for time_get_day
No definition for time_get_hour
No definition for time_get_minute
No definition for time_get_second
No definition for time_get_neg
No definition for time_get_second_part
No definition for time_set_year
No definition for time_set_month
No definition for time_set_day
No definition for time_set_hour
No definition for time_set_minute
No definition for time_set_second
No definition for time_set_neg
No definition for time_set_second_part
No definition for time_equal
No definition for error_errno
No definition for error_sqlstate
C:\software\ProjectManagement\Ruby\redmine-1.0.0>set RAILS_ENV=production
Before Doing this Configure database.yml
C:\software\ProjectManagement\Ruby\redmine-1.0.0>rake db:migrate
(in C:/software/ProjectManagement/Ruby/redmine-1.0.0)
rake aborted!
Access denied for user ‘root’@’localhost’ (using password: NO)
(See full trace by running task with –trace)
C:\software\ProjectManagement\Ruby\redmine-1.0.0>rake db:migrate
(in C:/software/ProjectManagement/Ruby/redmine-1.0.0)
== Setup: migrating ==========================================================
— create_table(“attachments”, {:force=>true})
-> 0.2820s
— create_table(“auth_sources”, {:force=>true})
-> 0.0110s
…………………………………………………………..
== ChangeChangesPathLengthLimit: migrated (0.0610s) ==========================

Now Try to run Mongrel
C:\software\ProjectManagement\Ruby\redmine-1.0.0>mongrel_rails start -p 3000 -e production
‘mongrel_rails’ is not recognized as an internal or external command,
operable program or batch file.

C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem install mongrel_service
Building native extensions. This could take a while…
ERROR: Error installing mongrel_service:
ERROR: Failed to build gem native extension.

C:/setup/Ruby186/bin/ruby.exe extconf.rb
checking for RegisterServiceCtrlHandlerEx()… no
checking for EnumServicesStatusEx()… no
checking for QueryServiceStatusEx()… 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:/setup/Ruby186/lib/ruby/gems/1.8/gems/win32-service-0.5.2 for inspection.
Results logged to C:/setup/Ruby186/lib/ruby/gems/1.8/gems/win32-service-0.5.2/gem_make.out

Try to Windows Option
C:\software\ProjectManagement\Ruby\redmine-1.0.0>gem install mongrel_service –platform x86-mswin32
Successfully installed win32-service-0.5.2-x86-mswin32
Successfully installed mongrel_service-0.3.4-x86-mswin32
2 gems installed
Installing ri documentation for win32-service-0.5.2-x86-mswin32…
Installing ri documentation for mongrel_service-0.3.4-x86-mswin32…
Installing RDoc documentation for win32-service-0.5.2-x86-mswin32…
Installing RDoc documentation for mongrel_service-0.3.4-x86-mswin32…

Now Run Redmine
C:\software\ProjectManagement\Ruby\redmine-1.0.0>mongrel_rails start -p 3000 -e production
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment…
C:/software/ProjectManagement/Ruby/redmine-1.0.0/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#ve
rsion_requirements is deprecated and will be removed on or after August 2010. Use #requirement
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel 1.1.5 available at 0.0.0.0:3000
** Use CTRL-C to stop.

use http://localhost:3000

With Apache

Configuring Apache + Mongrel on Windows is not significantly different from *nix.
Essentially, you need to proxy requests coming into Apache to Mongrel. What this boils down to is something like this:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ServerName http://www.myapp.comm
DocumentRoot “C:/web/myapp/public”
ProxyPass / http://www.myapp.com:3000/
ProxyPassReverse / http://www.myapp.com:3000/
ProxyPreserveHost On

Stick this in your httpd.conf (or httpd-vhost.conf if you’re including it).
It assumes you’re going to run mongrel on port 3000, your Rails root is in C:\web\myapp, and you’ll access the app at http://www.myapp.com.
To run the rails app in production mode:
mongrel_rails start -p 3000 -e production
And away you go (actually mongrel defaults to port 3000 so you could skip -p 3000 if you want).
The main difference is that you cannot daemonize mongrel on Windows (i.e. make it run in the background). Instead you can install it as a service using the mongrel_service gem.

0 down vote
I’m new to RoR and have been attempting the same thing on Windows Server 2008, here are some additional notes on getting mongrel going as a service:
if you get compilation errors when installing mongrel_service:
gem install mongrel_service
try using a binary instead by specifying your platform:
gem install mongrel_service –platform x86-mswin32
Additionally, to actually install the service you need to run this command in your RoR’s app directory:
mongrel_rails service::install –name MyApp -e production -p 3001 -a 0.0.0.0
(or to remove: mongrel_rails service::remove –name MyApp)
Then you should be able to start/stop the app “MyApp” in your windows services control panel.