# Script/server mongrel on windows

**URL:** <https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273>\
**Category:** Rails\
**Created:** [June 27, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273 "2006-06-27T20:50:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 27, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/1 "2006-06-27T20:50:45Z")

</div>

Supposedly the latest edge rail supports mongrel via script/server. I  
have mogrel all installed and working when called via:

mongrel\_rails service::start -N mw\_dev\_server

However when I do:

ruby script/server mongrel

I get:

PROBLEM: Mongrel is not available on your system (or not in your path)

Upon further investigation, it appears that mongrel prevents itself from  
loading on windows with the following lines:

unless RUBY\_PLATFORM !~ /mswin/ && !silence\_stderr { `mongrel_rails`  
}.blank?  
puts “PROBLEM: Mongrel is not available on your system (or not in  
your path)”  
exit 1  
end

From:  
[http://dev.rubyonrails.org/browser/trunk/railties/lib/commands/servers/mongrel.rb](http://dev.rubyonrails.org/browser/trunk/railties/lib/commands/servers/mongrel.rb)

Why is does it prevent itself form loading on windows? It seems  
lighttpd does this same thing. IS it possible to get this running on  
windows, and I am just missing something silly?

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 27, 2006, 9:25pm UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/2 "2006-06-27T21:25:32Z")

</div>

Alex W. wrote:

> Supposedly the latest edge rail supports mongrel via script/server. I  
> have mogrel all installed and working when called via:
> 
> mongrel\_rails service::start -N mw\_dev\_server
> 
> However when I do:
> 
> ruby script/server mongrel
> 
> I get:
> 
> PROBLEM: Mongrel is not available on your system (or not in your path)
> 
> Why is does it prevent itself form loading on windows? It seems  
> lighttpd does this same thing. IS it possible to get this running on  
> windows, and I am just missing something silly?

Upon further investigation, it appears that ruby doesn’t execute  
commands very well on the windows command line. Webrick servers are  
created entirely in the ruby script which is why they work just fine.

c:\foo\> mongrel\_rails start

### Mongrel starts just fine

c:\foo\> irb

> `mongrel_rails start`  
> Errno::ENOEXEC: Exec format error - mongrel\_rails start  
> from (irb):1:in ``’  
> from (irb):1

So does this mean ruby is blame for locking windows out of these  
development server options?

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 27, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/3 "2006-06-27T22:12:52Z")

</div>

I found when I need to execute a command that was on both windows/linux  
(on  
being .sh the other being .com) and both were on the paths correctly  
(would  
run fine at the prompt) I still needed to make ruby happy at this point.  
I  
did a check to see if I was running in windows, and if I was, I stuck a  
‘.com’ on the end of the command and it worked.

This may or may not help with mongrel, haven’t tried it yet. But this is  
my  
experince with Ruby and executing stuff on windows.

-Nick

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 28, 2006, 1:53am UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/4 "2006-06-28T01:53:08Z")

</div>

Nick S. wrote:

> I found when I need to execute a command that was on both windows/linux  
> (on  
> being .sh the other being .com) and both were on the paths correctly  
> (would  
> run fine at the prompt) I still needed to make ruby happy at this point.  
> I  
> did a check to see if I was running in windows, and if I was, I stuck a  
> ‘.com’ on the end of the command and it worked.
> 
> This may or may not help with mongrel, haven’t tried it yet. But this is  
> my  
> experince with Ruby and executing stuff on windows.
> 
> -Nick

Doesn’t seem to be any help. The mongrel gem does not include a com  
file so I just get a file not found error:

script/server: No such file or directory - mongrel\_rails.com start -p  
3000 -a 0.0.0.0

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 28, 2006, 7:02pm UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/5 "2006-06-28T19:02:40Z")

</div>

Jeff C. wrote:

> There’s a patch waiting to be committed, #5499, which should fix the  
> problem on win32.

Superswank.

Works perfectly. Thanks for the heads up.

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [June 28, 2006, 6:41am UTC](https://www.ruby-forum.com/t/script-server-mongrel-on-windows/96273/6 "2006-06-28T06:41:50Z")

</div>

There’s a patch waiting to be committed, #5499, which should fix the  
problem on win32.
