Skip to content

Instantly share code, notes, and snippets.

@machu
Created April 30, 2010 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machu/384562 to your computer and use it in GitHub Desktop.
Save machu/384562 to your computer and use it in GitHub Desktop.
Index: index.fcgi
===================================================================
--- index.fcgi (revision 3594)
+++ index.fcgi (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#!/usr/local/bin/ruby
# -*- coding: utf-8; -*-
#
# index.fcgi $Revision: 1.35 $
@@ -9,6 +9,7 @@
# You can redistribute it and/or modify it under GPL2.
#
require 'fcgi'
+begin
FCGI.each_cgi do |cgi|
begin
ENV.clear
@@ -17,6 +18,7 @@
define_method(:new) { cgi }
end
dir = File::dirname( cgi.env_table["SCRIPT_FILENAME"] )
+ STDERR.puts cgi.env_table["SCRIPT_FILENAME"]
Dir.chdir(dir) do
load 'index.rb'
end
@@ -26,3 +28,10 @@
end
end
end
+rescue => e
+ open('debug.log', 'w') do |f|
+ f.puts e
+ f.puts e.backtrace
+ f.puts
+ end
+end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment