The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Solving Tough Deploy Problems with FastCGI and Rails

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Guy Naor

Posts: 104
Nickname: familyguy
Registered: Mar, 2006

Guy Naor is one of the founders of famundo.com and a long time developer
Solving Tough Deploy Problems with FastCGI and Rails Posted: Feb 12, 2007 2:48 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Guy Naor.
Original Post: Solving Tough Deploy Problems with FastCGI and Rails
Feed Title: Famundo - The Dev Blog
Feed URL: http://devblog.famundo.com/xml/rss/feed.xml
Feed Description: A blog describing the development and related technologies involved in creating famundo.com - a family management sytem written using Ruby On Rails and postgres
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Guy Naor
Latest Posts From Famundo - The Dev Blog

Advertisement

Sometimes you deploy a new rails app with fastcgi and it just doesn't work. No errors, no logs, nothing! Usually it's some permission problems, or a missing file. But it also might be some odd problems like a wrong shebang line somewhere.

The problem with those is that you get no error and no indication of what went wrong. When using the spawner script you might see the actual appication being launched again and again by the spawner, only to die immediately.

I found a neat trick to see what's really going on when this happens. On the deployment directory (on the server you deploy to) edit the file:

vi vendor/rails/railties/lib/commands/process/spawner.rb

And look for the lines that redirect STDIN, STDOUT and STDERR to /dev/null. Comment those lines, and launch the spawner from the command line. The errors will start flowing into the console. Just look at them and you should be on your way to solving the problem.

Here is some code from the spawner file with the lines commented out:

def daemonize #:nodoc:
  exit if fork                   # Parent exits, child continues.
  Process.setsid                 # Become session leader.
  exit if fork                   # Zap session leader. See [1].
  Dir.chdir "/"                  # Release old working directory.
  File.umask 0000                # Ensure sensible umask. Adjust as needed.
#  STDIN.reopen "/dev/null"       # Free file descriptors and
#  STDOUT.reopen "/dev/null", "a" # point them somewhere sensible.
#  STDERR.reopen STDOUT           # STDOUT/ERR should better go to a logfile.
end

Read: Solving Tough Deploy Problems with FastCGI and Rails

Topic: Selenium on Rails, Reloaded: Client-Side Tests in Ruby Previous Topic   Next Topic Topic: GeoKit: a plugin for location-based Rails apps

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use