Michael Gorsuch | 28 Oct 2006 18:40
Picon
Gravatar

Mounting an app as '/' under Apache?

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?
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
why the lucky stiff | 28 Oct 2006 22:09
Favicon
Gravatar

Re: Mounting an app as '/' under Apache?

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
Michael Gorsuch | 28 Oct 2006 23:02
Picon
Gravatar

Re: Mounting an app as '/' under Apache?

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Yes - I had to run the reloader against 'blog.rb' first.  That still didn't account for the issue with the reference to <at> 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-INVRFxB3SCbTr1N2uX3BwuTW4wlIGRCZ@public.gmane.org > 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-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/camping-list


_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Michael Gorsuch | 28 Oct 2006 22:57
Picon
Gravatar

Re: Mounting an app as '/' under Apache?

Yes - I had to run the reloader against 'blog.rb' first.  That still didn't account for the issue with the reference to <at> 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-INVRFxB3SCbTr1N2uX3BwuTW4wlIGRCZ@public.gmane.org> 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-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/camping-list

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
why the lucky stiff | 29 Oct 2006 07:57
Favicon
Gravatar

Re: Mounting an app as '/' under Apache?

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
why the lucky stiff | 31 Oct 2006 18:01
Favicon
Gravatar

! camping-omnibus 1.5.176

  gem install camping-omnibus --source code.whytheluckystiff.net

Considering the number of optional dependencies now in Camping, I've put
together an eigengem which will load all of the recommended libraries that most
devoted campers will want: ActiveRecord, Mongrel, SQLite3, RedCloth and the
acts_as_versioned gem.  (Those last two are used in the examples.)

Stuff like mosquito and equipment could go in this, too.  Probably up to twenty
libs is good.  It's an omnibus, which means *B!G*.

_why

Gmane