Ticket #104 (closed defect: fixed)
FastCGI.serve does not work when asking to bind and index
| Reported by: | mgorsuch | Owned by: | why |
|---|---|---|---|
| Priority: | major | Milestone: | Camping 1.6 |
| Component: | camping/fastcgi.rb | Version: | 1.5 |
| Keywords: | Cc: |
Description
According to the docs, one should be able to call the following to bind Blog to '/':
Camping::FastCGI.serve("/path/to/my/apps",Blog)
This fails for me everything I try while running Apache w/ FastCGI.
I was getting an error about this line:
script_load[script] unless @mounts.has_key? smount
It stated that "@mounts" was nil. Since it is being called from 'self.serve', that makes sense, as '@mounts' is only reachable via in an instance of FastCGI.
I have made the following modifications to fastcgi.rb to correct the issue (diff):
60c60 < --- > attr_reader :mounts 176c176 < script_load[script] unless @mounts.has_key? smount --- >
My dispatch file looks like this:
#!/usr/bin/env ruby
current = File.dirname(__FILE__)
require 'rubygems'
require 'camping/fastcgi'
require 'camping/reloader'
ENV['FORCE_ROOT'] = "1"
Camping::Models::Base.establish_connection :adapter => 'sqlite3', :database => File.expand_path(current + '/camping.db')
Camping::FastCGI.serve(File.expand_path(current),Camping::Reloader.new('blog.rb'))
Please note that this is the first ticket I've ever submitted for another person's project. If I am missing any details, please let me know.
Michael michael.gorsuch@… http://www.styledbits.com
