# Mongrel service

**URL:** <https://www.ruby-forum.com/t/mongrel-service/195390>\
**Category:** Mongrel\
**Created:** [September 22, 2010, 2:48pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390 "2010-09-22T14:48:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [September 22, 2010, 2:48pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/1 "2010-09-22T14:48:54Z")

</div>

Hi all

Environment:

Windows 7 64 bit

Ruby 1.9.2.p0

Rails 3

I am getting the following error when I run the following command  
mongrel\_rails service::install -N MyTestApp\_4001 -p 4001 -e production:

“Msvcrt-ruby18.dll is missing”

Thanks in advance

Gerhard

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [September 22, 2010, 2:53pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/2 "2010-09-22T14:53:00Z")

</div>

On Wed, Sep 22, 2010 at 9:33 AM, Gerhard Koekemoer  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all

> 

You’re attempting to run Ruby 1.9 with a version of mongrel that  
hasn’t been compiled with Ruby 1.9 support.

Please install the 1.2.0 prerelease version:

gem install mongrel --pre

Also note that “mongrel\_rails start” will fail with Rails 3. Which  
means mongrel service will also fail. Before you report that back, see  
existing issues in relation to Rails 3:

## [http://github.com/fauna/mongrel/issues](http://github.com/fauna/mongrel/issues)

## Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupéry

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [September 22, 2010, 3:58pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/3 "2010-09-22T15:58:36Z")

</div>

Hi Luis

Thanks for the info.

The reason that I went for mongrel 1.1.5 is that the mongrel\_service  
0.4.2.beta3 gem requires it.

If I understand you correctly:

1. Because we are runnig ruby 1.9.2 we should run mongrel 1.2.0.pre  
which  
does not play nicely with mongrel service (I get an error asking for  
1.1.5).

2. The best solution would be to run 1.8.7 with mongrel 1.1.5 and  
mongrel\_service 0.4.3.beta3

Regards,

Gerhard

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [September 22, 2010, 4:57pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/4 "2010-09-22T16:57:10Z")

</div>

Hi Luis

I have now switched over to Ruby 1.8.7 and Mongrel 1.1.5 and Mongrel  
Service  
0.4.3.beta3 just to make sure these gems are compatible with each other.

Running the mongrel\_rails start command: “mongrel\_rails is not  
recognized as  
an internal or external command”, is this the error you spoke about?

Basically, it seems that there just isn’t any way at all of running  
mongrel  
as a service with Rails 3. Could you confirm this?

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [September 22, 2010, 5:12pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/5 "2010-09-22T17:12:23Z")

</div>

On Wed, Sep 22, 2010 at 11:12 AM, Gerhard Koekemoer  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Luis
> 
> I have now switched over to Ruby 1.8.7 and Mongrel 1.1.5 and Mongrel Service  
> 0.4.3.beta3 just to make sure these gems are compatible with each other.
> 
> Running the mongrel\_rails start command: “mongrel\_rails is not recognized as  
> an internal or external command”, is this the error you spoke about?

No. Is Ruby in your PATH?

> Basically, it seems that there just isn’t any way at all of running mongrel  
> as a service with Rails 3. Could you confirm this?

## Correct. Noone has worked on fix that.

## Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupéry

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 5:43am UTC](https://www.ruby-forum.com/t/mongrel-service/195390/6 "2011-02-01T05:43:37Z")

</div>

Hi Luis,  
I am trying to set up mongrel service on windows XP using Rails 2.3.2  
and mongrel 1.1.5.  
I manage to run my app as windows services but I am unable to go further  
with option such as -l, -P, or -C work.  
I tried -l and give full log file path but there’s no log file.  
I tried -P but I don’t see a pid file on the folder I specified.  
I tried to do -p 4100+3 but unable to have the service run for port  
4100, 4101 and 4102.  
I also would like to use -C so that I can use a yml config file but I  
did not see any documentation of how to configure it.  
I am familiar with mongrel\_cluster in linux but I wish I could get this  
working on windows machine as well.  
I’ve read some of your post and indeed it helped me to get this far.  
Please give me some light?

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 8:22pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/7 "2011-02-01T20:22:58Z")

</div>

My question is are we suppose to see a pid file in windows?  
and  
how are we allow the service to run multiple port like  
-p 3000+3 ?

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 11:31am UTC](https://www.ruby-forum.com/t/mongrel-service/195390/8 "2011-02-01T11:31:42Z")

</div>

Here are my notes:

Prerequisites:

upgrade ruby gems (gem update --system)  
verify that the currently installed version of mongrel is 1.1.5 or later  
and  
if it isn’t:  
uninstall mongrel (gem uninstall mongrel)  
install mongrel (gem install mongrel)  
verify that the currently installed version of mongrel\_service is  
0.4.beta3  
or later and if it isn’t:  
uninstall mongrel\_service (gem uninstall mongrel\_service)  
install mongrel\_service (gem install mongrel\_service)  
use gem list and verify that the mongrel\_service installed is 0.4 or  
later.  
If it isn’t, you need to take these extra steps:  
uninstall mongrel\_service (gem uninstall mongrel\_service)  
install mongrel\_service 0.4.beta3 (gem install mongrel\_service --pre)  
verify that the correct mongrel service has been installed by typing  
mongrel\_service at the dos prompt. Which should produce output like:  
Mongrel Windows Service, version 0.4.beta2  
© 2006-2010 The Mongrel development team.

mongrel\_service is not designed to run form commandline,  
please use mongrel\_rails service:: commands to create a win32 service.

If the version is less than 0.4.beta2, you need to manually copy the new  
mongrel\_service.exe. On my system, Ruby is installed in C:\Ruby and I  
would  
have to copy the file:

C:\Ruby\lib\ruby\gems\1.8\gems\mongrel\_service-0.4.beta3\resources\mongrel\_s  
ervice.exe  
to folder:  
C:\Ruby\bin

Finally, navigate to the folder holding the RoR application and invoke  
these  
commands to uninstall/install the service:

mongrel\_rails service::remove -N APALSvc

mongrel\_rails service::install -N APALSvc -D “AutoPallet/AutoLoader  
Service”  
-c “D:/Development/APAL6/APALUI” -e production -p 3035 --log  
log/mongrel.log

Cheers  
Pete

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 8:48pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/9 "2011-02-01T20:48:11Z")

</div>

On Tue, Feb 1, 2011 at 4:22 PM, Edison T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> My question is are we suppose to see a pid file in windows?  
> and

pid files are not created on Windows.

> how are we allow the service to run multiple port like  
> -p 3000+3 ?

## You need to create multiple services at different ports.

## Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupry

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 10:24pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/10 "2011-02-01T22:24:19Z")

</div>

On Tue, Feb 1, 2011 at 5:35 PM, Edison T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> My next questions is instead of creating multiple services, is there an  
> option to allow one service run multiple ports. Something like creating  
> a script file trigger all the ports when one service start?  
> What is the best practice? Thanks!! =)

No, right now there isn’t.

mongrel\_service was designed behind that goal, but the code that  
powers that part is missing.

(single mode is the only mode available in the current codebase)

## – Luis L. AREA 17

Perfection in design is achieved not when there is nothing more to add,  
but rather when there is nothing more to take away.  
Antoine de Saint-Exupry

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [March 23, 2011, 7:53am UTC](https://www.ruby-forum.com/t/mongrel-service/195390/11 "2011-03-23T07:53:41Z")

</div>

Luis L. wrote in post #943008:

> > Basically, it seems that there just isn’t any way at all of running mongrel  
> > as a service with Rails 3. Could you confirm this?
> 
> ## Correct. Noone has worked on fix that.
> 
> Luis L.

Is this still correct?

thanks, Anita

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [March 23, 2011, 12:14pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/12 "2011-03-23T12:14:42Z")

</div>

Yes, still correct.

Sent from mobile.  
On Mar 23, 2011 4:57 AM, “Anita G.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Luis L. wrote in post #943008:
> 
> > > Basically, it seems that there just isn’t any way at all of running  
> > > mongrel

---

<div class="post-metadata">

**Author:** ![Gerhard\_Koekemoer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/85e7bf/32.png) [@Gerhard\_Koekemoer](https://www.ruby-forum.com/u/Gerhard_Koekemoer)\
**Post date:** [February 1, 2011, 9:35pm UTC](https://www.ruby-forum.com/t/mongrel-service/195390/13 "2011-02-01T21:35:41Z")

</div>

Great, Thanks for confirmation!  
I’ve been confused by -d (daemon mode) -N (# of servers) parameter. I  
guess those won’t work in Windows. Some post gives me the impression  
that pid file exist in windows so I keep trying.  
My next questions is instead of creating multiple services, is there an  
option to allow one service run multiple ports. Something like creating  
a script file trigger all the ports when one service start?  
What is the best practice? Thanks!! =)
