Question

I've received some really great guidance from users of this site, and I'm thinking some advanced Rails people could assist me in resolving the following problem.

I'm attempting to deploy a simple Rails application on a win32 server.

I've been carefully working through these instructions (see http://functionalelegant.blogspot.com/2008/05/deploying-rails-on-windows.html) for win32 Rails application deployment.

I started from a more-or-less clean windows install, then downloaded and installed

  1. Ruby
  2. LightTPD
  3. Rails
  4. Zed's SCGI Rails Runner
  5. Windows Server 2003 Resource Kit Tools
  6. Ruby/DBI ADO package

After that, I've done the following:

I've commented out the line in the SCGI gem (which actually was causing trouble.)

I created the directory structure as suggested, with folders for logs.

I modified the scgi.yaml file and the Lighty config files to reflect my environmental settings.

After this, I wrote the batch scripts to start up Lighty and the SGCI process. They appear to run correctly. However, inside app-errors.log the following lines appear:

2009-05-15 16:48:06: (mod_scgi.c.2645) fcgi: got a FDEVENT_ERR. Don't know why. 
2009-05-15 16:48:06: (mod_scgi.c.2469) emergency exit: scgi: connection-fd: 7 fcgi-fd: 8 

Finally, when I navigate to http://localhost:xxxx/ I just see a blank page. Update: I just realized the blank page only appeared to be. Viewing the source revealed the following issue:

2C:/Ruby/lib/ruby/1.8/drb/drb.rb:573:in `load'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:612:in `recv_request'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:911:in `recv_request'"?C:/Ruby/lib/ruby/1.8/drb/drb.rb:1530:in `init_with_client'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1542:in `setup_message'"6C:/Ruby/lib/ruby/1.8/drb/drb.rb:1494:in `perform'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1589:in `main_loop'"3C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `loop'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `main_loop'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `start'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `main_loop'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1430:in `run'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `start'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `run'"9C:/Ruby/lib/ruby/1.8/drb/drb.rb:1347:in `initialize'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `new'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `start_service'"MC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/lib/scgi.rb:402:in `run'"HC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/bin/scgi_service:61"*C:/Ruby/bin/scgi_service:19:in `load'" C:/Ruby/bin/scgi_service:19:   mesg" too large packet

Note that 'ruby script/server' runs just fine, but the page then can't be seen externally.

Any ideas? Please let me know if anything jumps out at you.

Was it helpful?

Solution

I wrote the chapter for this in 'Deploying Rails Applications'. http://www.pragprog.com/titles/fr_deploy/deploying-rails-applications

Basically, you want mongrel, mongrel_service, and apache 2.2 with mod_proxy_balancer for windows.

You install 2 or more instances of your app with Mongrel running on separate ports. You set the services to autostart.

Then you set up apache to balance to them.

This is all outlined in the book, and I have some older articles on my website too - if you search for "deloying rails on windows" you'll find some pretty out of date stuff. The apache+mongrel way is the best way for Windows right now, and if you need additional help, feel free to let me know. I'd be glad to help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top