我想为一个朋友做一个应用程序,但他有共享主机,唯一的选择是fcgi,我找不到任何关于如何做到这一点的文档。有没有办法在FCGI上运行Rails3?
发布于 2010-07-21 17:25:19
Rails3构建在Rack之上,Rack提供了一个FastCGI处理程序。
发布于 2010-11-07 22:43:03
public/随便什么.fcgi
#!/usr/bin/ruby
require_relative '../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(YOURAPPNAME::Application)查看示例应用程序here
https://stackoverflow.com/questions/3296206
复制相似问题