[Mongrel] how to configure mongrel_cluster in windows

James Tucker jftucker at gmail.com
Wed Nov 21 01:18:25 EST 2007


Shiva Kumaran wrote:
> Rafael García wrote:
>> Shiva Kumaran escribió:
>>> hi,
>>> how to configure mongrel_cluster in windows.
>>> mongrel_rails cluster::configure -e development -p 3000 -N 2 i have used
>>> this one its configured correctly then if i start the server it is
>>> throwing error.if any one knows how to configure help me
>>>
>>> with regards
>>> shiva
>>>   
>> what error?
> 
> iam getting this error
> 
> 
> D:\project\sutra>mongrel_rails cluster::start
> starting port 3000
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cluster/init.rb
> :98:in ``': Exec format error - mongrel_rails start -d -e development -p 
> 3000 -P
>  tmp/pids/mongrel.3000.pid -l log/mongrel.3000.log (Errno::ENOEXEC)
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cl
> uster/init.rb:98:in `start'
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cl
> uster/init.rb:80:in `each'
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cl
> uster/init.rb:80:in `start'
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cl
> uster/init.rb:239:in `run'
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.1-mswin32/bin/../lib/mon
> grel/command.rb:212:in `run'
>         from 
> c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.1-mswin32/bin/mongrel_ra
> ils:281
>         from c:/ruby/bin/mongrel_rails:16:in `load'
>         from c:/ruby/bin/mongrel_rails:16

Yeah this is an unfortunate bug with the way that 'bin' files are setup on windows. In particular, you can't call exec on a text file containing nothing but ruby. The solution is to add ".bat" or ".cmd" to the binary name in the offending call to system / exec, lead it with a call to ruby.

It's probably worth noting at this point that the "-d" option doesn't work either, so I am not sure the current cluster commands will work on windows.


More information about the Mongrel-users mailing list