Hello everyone, I have a site with a collection of camping apps. I''m trying to force one of them, blog.rb, to run as the index (''/''). I think that I understand the RDoc as stating that I can execute the following to make that happen: Camping::FastCGI.serve File.expand_path(current), Blog But, when doing so, I recieve the following error: Camping Problem!*/*/NoMethodError undefined method `has_key?'' for nil:NilClass - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:176:in `serve'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:173:in `each'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:173:in `serve'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:90:in `start'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:75:in `each'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:75:in `start'' - /home/styledbits/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/fastcgi.rb:172:in `serve'' - dispatch.fcgi:9 I''m stuck trying to understand what exactly is breaking down here. I''m trying to get Apache running on my dev box to check into this further. My dispatch.fcgi file follows: #!/usr/bin/env ruby current = File.dirname(__FILE__) require ''rubygems'' require ''camping/fastcgi'' 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), Blog *** Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20061028/3a469f62/attachment.html
On Sat, Oct 28, 2006 at 12:40:43PM -0400, Michael Gorsuch wrote:> Hello everyone, I have a site with a collection of camping apps. I''m trying > to force one of them, blog.rb, to run as the index (''/'').[...]> require ''rubygems'' > require ''camping/fastcgi'' > 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), BlogI believe you will need to load the blog app first in order to reference the Blog const you have there. But on further looking at this, I think I need to improve things to work like this: Camping::FastCGI.serve File.expand_path(current), :index => "/blog" With an optional {:redirect => true} options or such to indicate whether the app is to be moved to root or simply aliased there. I could use some other thoughts on this. _why
Yes - I had to run the reloader against ''blog.rb'' first. That still didn''t account for the issue with the reference to @mounts in the class method. I like your proposal - I think that is VERY clear and clean. On 10/28/06, why the lucky stiff <why at whytheluckystiff.net> wrote:> > On Sat, Oct 28, 2006 at 12:40:43PM -0400, Michael Gorsuch wrote: > > Hello everyone, I have a site with a collection of camping apps. I''m > trying > > to force one of them, blog.rb, to run as the index (''/''). > > [...] > > > require ''rubygems'' > > require ''camping/fastcgi'' > > 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), Blog > > I believe you will need to load the blog app first in order to reference > the > Blog const you have there. > > But on further looking at this, I think I need to improve things to work > like > this: > > Camping::FastCGI.serve File.expand_path(current), :index => "/blog" > > With an optional {:redirect => true} options or such to indicate whether > the app > is to be moved to root or simply aliased there. I could use some other > thoughts > on this. > > _why > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20061028/89a7ff02/attachment.html
Ha! You know, that response probably didn''t make much sense. I actually thought this was a message regarding a bug I submitted to your Trac system. It was ticket #104. I had to patch the 1.5 source to get around the exception I was receiving after I figured out that I needed to preload my Blog class. Sorry about that. On 10/28/06, Michael Gorsuch <michael.gorsuch at gmail.com> wrote:> > Yes - I had to run the reloader against ''blog.rb'' first. That still > didn''t account for the issue with the reference to @mounts in the class > method. > > I like your proposal - I think that is VERY clear and clean. > > On 10/28/06, why the lucky stiff <why at whytheluckystiff.net> wrote: > > > > On Sat, Oct 28, 2006 at 12:40:43PM -0400, Michael Gorsuch wrote: > > > Hello everyone, I have a site with a collection of camping apps. I''m > > trying > > > to force one of them, blog.rb, to run as the index (''/''). > > > > [...] > > > > > require ''rubygems'' > > > require ''camping/fastcgi'' > > > 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), Blog > > > > I believe you will need to load the blog app first in order to reference > > the > > Blog const you have there. > > > > But on further looking at this, I think I need to improve things to work > > like > > this: > > > > Camping::FastCGI.serve File.expand_path(current), :index => "/blog" > > > > With an optional {:redirect => true} options or such to indicate whether > > the app > > is to be moved to root or simply aliased there. I could use some other > > thoughts > > on this. > > > > _why > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20061028/781a5bee/attachment-0001.html
On Sat, Oct 28, 2006 at 05:02:44PM -0400, Michael Gorsuch wrote:> It was ticket #104. I had to patch the 1.5 source to get around the > exception I was receiving after I figured out that I needed to preload my > Blog class.Well, well, look at that. Lovely! So, thanks for stepping in and just right stamping on that nasty thing straightway. Kabllooom. Triumpfant. _why