Magnus Holm | 3 Jul 02:52 2008
Picon

Re: Getting rid of the route maker



On Tue, Jun 24, 2008 at 5:07 PM, _why <why-INVRFxB3SCbTr1N2uX3BwuTW4wlIGRCZ@public.gmane.org> wrote:
On Tue, Jun 24, 2008 at 01:05:54PM +0200, Magnus Holm wrote:
> Man, that's way better than removing 135 bytes! I *love* the implementation!

I have always wanted to use Method#to_proc in Camping.

> Alright! What about releasing 2.0? I've closed a lot of tickets on the
> tracker, and I don't think we need more for a 2.0. There is no point
> of waiting anymore, IMO!

I have two things left: I need to figure out if I want to merge
zimbatm's Markaby patch.  And I'd like to go through Rack a bit more
myself and see if I can cut down the work we're doing.  Hopefully
today or tomorrow, though!

_why
_______________________________________________
Camping-list mailing list
Camping-list-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/camping-list

Come on, you lazy interrogative! Are your shoes too heavy? :-(

--
Magnus Holm
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
_why | 7 Jul 18:46 2008
Picon

Re: Getting rid of the route maker

On Thu, Jul 03, 2008 at 02:52:41AM +0200, Magnus Holm wrote:
> Come on, you lazy interrogative! Are your shoes too heavy? :-(

Bzzt!  (Drawing on backup camping power grids...)  Very sorry to be
bad about this.  Yeah, lots of Shoes stuff going on this week as
we're shooting for a July 31st release and there many bothersome bugs
to smash.

You've all done a lot of fanastic work and I say we keep working a
bit longer.  I just merged zimbatm's week-old patches and I think it
would be great if we could get more campers to mess with judofyr's
gems, as I think camping 2.0 will inspire some breakages.

Augusttime would be better for me, but let's talk about what you
guys want to do.

_why
Joshua Miller | 10 Jul 17:01 2008
Picon

AR Sessions

Hi all,

I have a little camping micro-blog that's working well with the cookie
session store, but falls over when I try to use the AR session store.
The changes I made were:

require 'camping/session' becomes require 'camping/ar/session'

module Blog; include Camping::Session; end becomes module Blog;
include Camping::ARSession; end

and I did the create_schema in Blog.create.

It set up the session table correctly, it adds a new row with a
session id and sets a cookie on the browser correctly, but it never
saves anything to the session state hash.  Do I need to do something
differently to make  <at> state save itself?  Using the cookie session
store, changes are saved anytime I do something to  <at> state, which is
how I would expect it to work.

I'm using the latest version from why's git repo with the default sqlite setup.

Thanks!
Josh
Eric Mill | 11 Jul 07:06 2008
Picon

Troubleshooting: Camping 2.0 on CGI on a shared host

Specifically, Dreamhost.  I'm trying to figure out how to get this to
work the standard dispatch.cgi or dispatch.fcgi setup.  I've been
using the instructions that Magnus sent out when he first announced
his plan for Camping 2.0, but they either no longer apply, or I'm an
edge case.

I've been pushing at it for a while, just to get it working on CGI,
and the problem seems to be that dispatch.cgi doesn't end in .ru!
Rack tries to "require 'dispatch.cgi'", which is no good.  Here's my
dispatch.cgi, with names changed to protect the innocent:

==================

#!/usr/bin/env rackup

ENV['GEM_PATH'] = '/path/to/local/gems'
ENV['GEM_HOME'] = '/path/to/local/gems'
ENV['FORCE_ROOT']=1.to_s

Dir.chdir '/path/to/app'

require 'app'
App::Models::Base.establish_connection :adapter => 'sqlite3',
:database => 'app.db'
App.create

run App

=============

And the error trace, as reported through apache's error logs:

/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- dispatch.cgi
(LoadError)
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
  from /usr/lib/ruby/gems/1.8/gems/rack-0.3.0/bin/rackup:92
  from /usr/bin/rackup:19:in `load'
  from /usr/bin/rackup:19
Premature end of script headers: dispatch.cgi

I'm still trying to get my head around the new Rack setup, the problem
might be some simple naivete on my part.  Anyone have any ideas how I
can push forward?

Thanks,
Eric
Eric Mill | 11 Jul 07:33 2008
Picon

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

Some progress: I put most of the code from dispatch.cgi into a
"config.ru", and dispatch.cgi now uses backticks to literally call
'/usr/bin/env rackup'.  This works, yet now calls to "/" redirect to
"/dispatch.cgi/" (this is truly the path in my browser location bar),
and it messes with my routing.

====  config.ru  ======
Dir.chdir '/path/to/app'
require 'app'
App::Models::Base.establish_connection :adapter => 'sqlite3',
:database => 'app.db'
App.create
run App

==== dispatch.cgi  ====
#!/usr/bin/ruby
ENV['GEM_PATH'] = '/path/to/gems'
ENV['GEM_HOME'] = '/path/to/gems'
puts `/usr/bin/env rackup`

And now I am definitely giving up for the night and sleeping.  Any ideas?

Thanks,
Eric

On Fri, Jul 11, 2008 at 1:06 AM, Eric Mill <kprojection@...> wrote:
> Specifically, Dreamhost.  I'm trying to figure out how to get this to
> work the standard dispatch.cgi or dispatch.fcgi setup.  I've been
> using the instructions that Magnus sent out when he first announced
> his plan for Camping 2.0, but they either no longer apply, or I'm an
> edge case.
>
> I've been pushing at it for a while, just to get it working on CGI,
> and the problem seems to be that dispatch.cgi doesn't end in .ru!
> Rack tries to "require 'dispatch.cgi'", which is no good.  Here's my
> dispatch.cgi, with names changed to protect the innocent:
>
> ==================
>
> #!/usr/bin/env rackup
>
> ENV['GEM_PATH'] = '/path/to/local/gems'
> ENV['GEM_HOME'] = '/path/to/local/gems'
> ENV['FORCE_ROOT']=1.to_s
>
> Dir.chdir '/path/to/app'
>
> require 'app'
> App::Models::Base.establish_connection :adapter => 'sqlite3',
> :database => 'app.db'
> App.create
>
> run App
>
> =============
>
> And the error trace, as reported through apache's error logs:
>
> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require': no such file to load -- dispatch.cgi
> (LoadError)
>  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
>  from /usr/lib/ruby/gems/1.8/gems/rack-0.3.0/bin/rackup:92
>  from /usr/bin/rackup:19:in `load'
>  from /usr/bin/rackup:19
> Premature end of script headers: dispatch.cgi
>
> I'm still trying to get my head around the new Rack setup, the problem
> might be some simple naivete on my part.  Anyone have any ideas how I
> can push forward?
>
> Thanks,
> Eric
>
Magnus Holm | 14 Jul 10:44 2008
Picon

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

What about dropping the idea of config.ru and just create a dispatch.cgi like this?

    #!/usr/bin/env ruby
    require 'app'
    Rack::Handler::CGI.run(App)

On Fri, Jul 11, 2008 at 7:33 AM, Eric Mill <kprojection-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Some progress: I put most of the code from dispatch.cgi into a
"config.ru", and dispatch.cgi now uses backticks to literally call
'/usr/bin/env rackup'.  This works, yet now calls to "/" redirect to
"/dispatch.cgi/" (this is truly the path in my browser location bar),
and it messes with my routing.

====  config.ru  ======
Dir.chdir '/path/to/app'
require 'app'
App::Models::Base.establish_connection :adapter => 'sqlite3',
:database => 'app.db'
App.create
run App

==== dispatch.cgi  ====
#!/usr/bin/ruby
ENV['GEM_PATH'] = '/path/to/gems'
ENV['GEM_HOME'] = '/path/to/gems'
puts `/usr/bin/env rackup`


And now I am definitely giving up for the night and sleeping.  Any ideas?

Thanks,
Eric

On Fri, Jul 11, 2008 at 1:06 AM, Eric Mill <kprojection-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Specifically, Dreamhost.  I'm trying to figure out how to get this to
> work the standard dispatch.cgi or dispatch.fcgi setup.  I've been
> using the instructions that Magnus sent out when he first announced
> his plan for Camping 2.0, but they either no longer apply, or I'm an
> edge case.
>
> I've been pushing at it for a while, just to get it working on CGI,
> and the problem seems to be that dispatch.cgi doesn't end in .ru!
> Rack tries to "require 'dispatch.cgi'", which is no good.  Here's my
> dispatch.cgi, with names changed to protect the innocent:
>
> ==================
>
> #!/usr/bin/env rackup
>
> ENV['GEM_PATH'] = '/path/to/local/gems'
> ENV['GEM_HOME'] = '/path/to/local/gems'
> ENV['FORCE_ROOT']=1.to_s
>
> Dir.chdir '/path/to/app'
>
> require 'app'
> App::Models::Base.establish_connection :adapter => 'sqlite3',
> :database => 'app.db'
> App.create
>
> run App
>
> =============
>
> And the error trace, as reported through apache's error logs:
>
> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require': no such file to load -- dispatch.cgi
> (LoadError)
>  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
>  from /usr/lib/ruby/gems/1.8/gems/rack-0.3.0/bin/rackup:92
>  from /usr/bin/rackup:19:in `load'
>  from /usr/bin/rackup:19
> Premature end of script headers: dispatch.cgi
>
> I'm still trying to get my head around the new Rack setup, the problem
> might be some simple naivete on my part.  Anyone have any ideas how I
> can push forward?
>
> Thanks,
> Eric
>
_______________________________________________
Camping-list mailing list
Camping-list-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/camping-list



--
Magnus Holm
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Eric Mill | 14 Jul 14:37 2008
Picon

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

Actually, that is what I'm doing now, and I'm still seeing the same
behavior -- redirects preface the URL with "/dispatch.cgi/", and the
Camping cookies are valid under path "/dispatch.cgi/".  I have another
camping app on the same account, that uses Camping 1.5.180, and when I
first tried it under CGI I didn't get this behavior.  I'm using the
same .htaccess, too.

-- Eric

On Mon, Jul 14, 2008 at 4:44 AM, Magnus Holm <judofyr@...> wrote:
> What about dropping the idea of config.ru and just create a dispatch.cgi
> like this?
>
>     #!/usr/bin/env ruby
>     require 'app'
>     Rack::Handler::CGI.run(App)
>
> On Fri, Jul 11, 2008 at 7:33 AM, Eric Mill <kprojection@...> wrote:
>>
>> Some progress: I put most of the code from dispatch.cgi into a
>> "config.ru", and dispatch.cgi now uses backticks to literally call
>> '/usr/bin/env rackup'.  This works, yet now calls to "/" redirect to
>> "/dispatch.cgi/" (this is truly the path in my browser location bar),
>> and it messes with my routing.
>>
>> ====  config.ru  ======
>> Dir.chdir '/path/to/app'
>> require 'app'
>> App::Models::Base.establish_connection :adapter => 'sqlite3',
>> :database => 'app.db'
>> App.create
>> run App
>>
>> ==== dispatch.cgi  ====
>> #!/usr/bin/ruby
>> ENV['GEM_PATH'] = '/path/to/gems'
>> ENV['GEM_HOME'] = '/path/to/gems'
>> puts `/usr/bin/env rackup`
>>
>>
>> And now I am definitely giving up for the night and sleeping.  Any ideas?
>>
>> Thanks,
>> Eric
>>
>> On Fri, Jul 11, 2008 at 1:06 AM, Eric Mill <kprojection@...> wrote:
>> > Specifically, Dreamhost.  I'm trying to figure out how to get this to
>> > work the standard dispatch.cgi or dispatch.fcgi setup.  I've been
>> > using the instructions that Magnus sent out when he first announced
>> > his plan for Camping 2.0, but they either no longer apply, or I'm an
>> > edge case.
>> >
>> > I've been pushing at it for a while, just to get it working on CGI,
>> > and the problem seems to be that dispatch.cgi doesn't end in .ru!
>> > Rack tries to "require 'dispatch.cgi'", which is no good.  Here's my
>> > dispatch.cgi, with names changed to protect the innocent:
>> >
>> > ==================
>> >
>> > #!/usr/bin/env rackup
>> >
>> > ENV['GEM_PATH'] = '/path/to/local/gems'
>> > ENV['GEM_HOME'] = '/path/to/local/gems'
>> > ENV['FORCE_ROOT']=1.to_s
>> >
>> > Dir.chdir '/path/to/app'
>> >
>> > require 'app'
>> > App::Models::Base.establish_connection :adapter => 'sqlite3',
>> > :database => 'app.db'
>> > App.create
>> >
>> > run App
>> >
>> > =============
>> >
>> > And the error trace, as reported through apache's error logs:
>> >
>> > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
>> > `gem_original_require': no such file to load -- dispatch.cgi
>> > (LoadError)
>> >  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
>> > `require'
>> >  from /usr/lib/ruby/gems/1.8/gems/rack-0.3.0/bin/rackup:92
>> >  from /usr/bin/rackup:19:in `load'
>> >  from /usr/bin/rackup:19
>> > Premature end of script headers: dispatch.cgi
>> >
>> > I'm still trying to get my head around the new Rack setup, the problem
>> > might be some simple naivete on my part.  Anyone have any ideas how I
>> > can push forward?
>> >
>> > Thanks,
>> > Eric
>> >
>> _______________________________________________
>> Camping-list mailing list
>> Camping-list@...
>> http://rubyforge.org/mailman/listinfo/camping-list
>
>
>
> --
> Magnus Holm
> _______________________________________________
> Camping-list mailing list
> Camping-list@...
> http://rubyforge.org/mailman/listinfo/camping-list
>
Bluebie, Jenna | 14 Jul 14:59 2008

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

Could you show us the .htaccess please? :)
Bluebie, Jenna | 14 Jul 15:14 2008

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

Also, is it possible that you could simply rename dispatch.cgi to  
something like 'appname' and use htaccess to grant that file cgi  
execution type permissions? Or does this need to be on the root of a  
domain?
Bluebie, Jenna | 14 Jul 15:16 2008

Re: Troubleshooting: Camping 2.0 on CGI on a shared host

can you please try adding to htaccess SetEnv SCRIPT_NAME /path/to/app

Assuming your dispatch is in /path/to/app/dispatch.cgi

Let us know what happens!

Gmane