How to configure mongrel_cluster in windows

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

Shiva K. 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?

On Nov 20, 2007 10:53 AM, Shiva K. [email protected] wrote:

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

mongrel_cluster rely on fork() functionality, which is missing in the
ruby mswin32 implementation, so it will fail trying to “daemonize”
mongrel_rails.

Right now, a workaround is set N services (mongrel_service) for N
members of the cluster.

This remembers me need to get the dust off on some stuff… but that
takes time :stuck_out_tongue:


Luis L.
Multimedia systems

Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

Rafael García wrote:

Shiva K. 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:ineach’
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:inrun’
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:inload’
from c:/ruby/bin/mongrel_rails:16

On Nov 21, 2007 3:18 AM, James T. [email protected] wrote:

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.

this is the way system() works. a shame :stuck_out_tongue:

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.

Yep, I keep telling this over and over, no mongrel_cluster for windows.


Luis L.
Multimedia systems

Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

Luis L. wrote:

On Nov 21, 2007 3:18 AM, James T. [email protected] wrote:

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.

this is the way system() works. a shame :stuck_out_tongue:

It is actually possible to make it work:

  • Implement a program which scans for, and runs any shebang on the
    given argument (roughly emulating execve).
  • set PATHEXT+=.
  • Associate extensionless files with the program you wrote for step 1.

Although that’s well beyond the scope of mongrel herself.

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.

Yep, I keep telling this over and over, no mongrel_cluster for windows.

With regard to fork, IIRC win32-process adds this functionality.

Shiva K. wrote:

tmp/pids/mongrel.3000.pid -l log/mongrel.3000.log (Errno::ENOEXEC)
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:inrun’
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.

On Nov 21, 2007 4:56 AM, James T. [email protected] wrote:

  • set PATHEXT+=.
  • Associate extensionless files with the program you wrote for step 1.

Although that’s well beyond the scope of mongrel herself.

Is a bit more complicated than that, but as you said, is beyond
mongrel scope :wink:

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.

Yep, I keep telling this over and over, no mongrel_cluster for windows.

With regard to fork, IIRC win32-process adds this functionality.

It does some funny things sometimes. And other weird ones since
sometimes you cannot reproduce the failing procedure to report a bug
:stuck_out_tongue:


Luis L.
Multimedia systems

Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi