Topic: Running mongrel as a service.

I installed mongrel 1.2.0.pre2 (ruby 1.9.2 and rails 3.0.8) and try to run it as a service using:

rails server -d -e production

It then crashes (output below). Does mongrel work with windows? I can see it is trying to do a fork, hehe.

Any workarounds, etc. I really need to get this working.

Thanks,

Kevin.

=> Booting Mongrel
=> Rails 3.0.8 application starting in development on http://0.0.0.0:3000
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/core_
ext/process/daemon.rb:3:in `fork': fork() function is unimplemented on this mach
ine (NotImplementedError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_
support/core_ext/process/daemon.rb:3:in `daemon'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/server.rb:2
67:in `daemonize_app'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/server.rb:2
06:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.8/lib/rails/comman
ds/server.rb:65:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.8/lib/rails/comman
ds.rb:30:in `block in <top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.8/lib/rails/comman
ds.rb:27:in `tap'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.8/lib/rails/comman
ds.rb:27:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

Re: Running mongrel as a service.

I use something like:

mongrel_rails service::install -N MyAppName -c MyAppLocation -p 3000 -e Mode

Re: Running mongrel as a service.

I did this before using the -d option, and it worked. The problem is after I create the service, start it, and in the broswer go localhost:3000, the browser displays 'Internet Explorer cannot display the webpage'.

Once I start mongrel as a service, shouldn't I be able to view the web page?

Thanks

Last edited by kevin1972 (2011-06-21 13:00:15)

Re: Running mongrel as a service.

Further, I added a log to mongrel and get this output:

** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require': no such file to load -- dispatcher (LoadError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `block in require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:225:in `load_dependency'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.8/lib/active_support/dependencies.rb:239:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:148:in `rails'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in `block (2 levels) in run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in `listener'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in `block in run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in `call'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in `initialize'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in `new'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in `run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/command.rb:210:in `run'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282:in `<top (required)>'
    from C:/Ruby192/bin/mongrel_rails:19:in `load'
    from C:/Ruby192/bin/mongrel_rails:19:in `<main>'