public
Created

Some CGI dispatch file for use ...

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
require 'rubygems'
require 'fcgi'
 
ENV['RAILS_ENV'] ||= 'development'
 
ENV['GEM_HOME'] ||= '/home/user/.gems'
require 'rubygems'
Gem.clear_paths
 
require File.join(File.dirname(__FILE__), '../config/environment')
 
class Rack::PathInfoRewriter
def initialize(app)
@app = app
end
 
def call(env)
env.delete('SCRIPT_NAME')
parts = env['REQUEST_URI'].split('?')
env['PATH_INFO'] = parts[0]
env['QUERY_STRING'] = parts[1].to_s
@app.call(env)
end
end
 
Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(X::Application)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.