mongrel_service on Windows 7 64bit

My current applications run on Linux in production, but I still develop on Windows PCs. My main works PC runs Windows 7 Pro 64bit. This isn’t too much of a problem. Just a couple of things don’t work (like wicked_pdf), but I can fire up a VirtualBox Linux image and test via that when I need to.

However, I needed to provide a production version of one of my applications for a colleague writing some documentation. In the past running a mongrel instance as a service on my PC has been great for this, but having recently upgraded to Rails 3, I’ve managed to kill my mongrel_service gem. Unfortunately reinstalling was not as easy as I thought. To get it to work I had to do the following:

Install win32-service separately and force it to install the binary version rather than build it from source. To do that:

gem install win32-service --platform x86-mswin32

Notice the double dash before platform. The blog where I first got this from had only one dash which caused me a little head scratching.

Then I had to install the ‘pre’ version of mongrel_service:

gem install mongrel_service --pre

I found that step from this blog.

BTW, I run a command prompt as the administrator when running gem commands (right click cmd icon and select ‘run as administrator’)

Once that was done I could use the mongrel_service as usual:

C:\Windows\system32>mongrel_rails service::install -N OLM_demo \ -c C:\web\public_site\olm -p 8001 -e production
This entry was posted in Ruby. Bookmark the permalink.