I''m trying to get lighttpd with fcgi working but am not having any luck. I have two apps that both work fine under plain cgi with Apache. One of the apps allows you to login, which places a User object in the session, and it works great. Under lighttpd with fcgi however, it dies once that User object is in the session: [Mon Mar 21 09:52:05 CST 2005] Dispatcher failed to catch: Session contained objects where the class definition wasn''t available. Remember to require classes for all objects kept in the session. The session has been deleted. (Original exception: undefined class/module User [ArgumentError]) (ActionController::SessionRestoreError) /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/cgi_process.rb:86:in `session'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/base.rb:659:in `assign_shortcuts'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/base.rb:316:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/rescue.rb:20:in `process_with_exception'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/dispatcher.rb:34:in `dispatch'' /Users/ben/Sites/admin.urbanvillages.int/public/dispatch.fcgi:11 /Users/ben/Sites/admin.urbanvillages.int/public/dispatch.fcgi:9:in `each_cgi'' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.5/./fcgi.rb:597:in `each'' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.5/./fcgi.rb:597:in `each_cgi'' /Users/ben/Sites/admin.urbanvillages.int/public/dispatch.fcgi:9 I thought we were done manually requiring our models a long time ago. Even so, I tried requiring it in environment.rb, dispatch.fcgi, and I even in cgi_process.rb. My User class is never found. Any ideas? -- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
On Mon, 21 Mar 2005 10:00:31 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I thought we were done manually requiring our models a long time ago. > Even so, I tried requiring it in environment.rb, dispatch.fcgi, and I > even in cgi_process.rb. My User class is never found. > > Any ideas?In my experience, an error message like this is an indication of a deeper problem and not to be taken literally. For example, the error message "undefined method" *really* means "there was a syntax error preventing that helper from loading, so the method you''re trying to use didn''t get loaded even though you defined it". So based on your error message, I would say that something is going on at a lower level, like fastcgi is dying before the User model ever gets loaded, so rails gives you this error about the model not being found when really that''s just a symptom caused by a problem somewhere else. I can report a successfun lighttpd/fcgi/linux installation though, so don''t give up hope ;) What I would try doing to fix the problem: - reinstall the fastcgi gem? - reinstall fastcgi itself? - check your lighttpd setup? Should look something like this: server.indexfiles = ( "dispatch.fcgi" ) server.document-root = "/path/to/rails/public" server.error-handler-404 = "/dispatch.fcgi" fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/tmp/rails.socket", "idle-timeout" => 120, "bin-path" => "/path/to/rails/public/dispatch.fcgi" ) ), ".fcgi" => ( "localhost" => ( "socket" => "/tmp/rails1.socket", "idle-timeout" => 120, "bin-path" => "/path/to/rails/public/dispatch.fcgi" ) ) ) Hope this helps. -- One Guy With A Camera http://rbpark.ath.cx
On Mon, 21 Mar 2005, Rob Park wrote:> On Mon, 21 Mar 2005 10:00:31 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I thought we were done manually requiring our models a long time ago. >> Even so, I tried requiring it in environment.rb, dispatch.fcgi, and I >> even in cgi_process.rb. My User class is never found. >> >> Any ideas? > > In my experience, an error message like this is an indication of a > deeper problem and not to be taken literally. For example, the error > message "undefined method" *really* means "there was a syntax error > preventing that helper from loading, so the method you''re trying to > use didn''t get loaded even though you defined it".this is probably correct - if you are running lighthttpd under a different user than you were running apache you could be blowing up on permission errors... -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================
I finally figured it out, thanks to someone on #rubyonrails that was having the same problem. He had a working application on his OSX box, and it wouldn''t run on a new Linux box. I also have various machines, some worked, some didn''t. The solution is to add "model :user" to my application.rb. The person on IRC has no idea why that fixes it, and the documentation for the model method doesn''t say when you need to use it. It''s also very odd that this same code without the "model :user" works fine on some machines. On Mon, 21 Mar 2005 12:10:29 -0700 (MST), Ara.T.Howard <Ara.T.Howard-32lpuo7BZBA@public.gmane.org> wrote:> On Mon, 21 Mar 2005, Rob Park wrote: > > > On Mon, 21 Mar 2005 10:00:31 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I thought we were done manually requiring our models a long time ago. > >> Even so, I tried requiring it in environment.rb, dispatch.fcgi, and I > >> even in cgi_process.rb. My User class is never found. > >> > >> Any ideas? > > > > In my experience, an error message like this is an indication of a > > deeper problem and not to be taken literally. For example, the error > > message "undefined method" *really* means "there was a syntax error > > preventing that helper from loading, so the method you''re trying to > > use didn''t get loaded even though you defined it". > > this is probably correct - if you are running lighthttpd under a different > user than you were running apache you could be blowing up on permission > errors... > > -a > -- > ==============================================================================> | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov > | PHONE :: 303.497.6469 > | When you do something, you should burn yourself completely, like a good > | bonfire, leaving no trace of yourself. --Shunryu Suzuki > ==============================================================================>-- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
I think that this is only (load works too I think) way how to "require for session" in some circumstances (for me Mac OSX, ruby 1.8.2, rails > 0.9). Require just doesn''t work for this. Is this bug or feature? Pepe On 21.3.2005, at 20:31, Ben Sinclair wrote:> I finally figured it out, thanks to someone on #rubyonrails that was > having the same problem. He had a working application on his OSX box, > and it wouldn''t run on a new Linux box. I also have various machines, > some worked, some didn''t. > > The solution is to add "model :user" to my application.rb. The person > on IRC has no idea why that fixes it, and the documentation for the > model method doesn''t say when you need to use it. It''s also very odd > that this same code without the "model :user" works fine on some > machines. > > > On Mon, 21 Mar 2005 12:10:29 -0700 (MST), Ara.T.Howard > <Ara.T.Howard-32lpuo7BZBA@public.gmane.org> wrote: >> On Mon, 21 Mar 2005, Rob Park wrote: >> >>> On Mon, 21 Mar 2005 10:00:31 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>>> I thought we were done manually requiring our models a long time >>>> ago. >>>> Even so, I tried requiring it in environment.rb, dispatch.fcgi, and >>>> I >>>> even in cgi_process.rb. My User class is never found. >>>> >>>> Any ideas? >>> >>> In my experience, an error message like this is an indication of a >>> deeper problem and not to be taken literally. For example, the error >>> message "undefined method" *really* means "there was a syntax error >>> preventing that helper from loading, so the method you''re trying to >>> use didn''t get loaded even though you defined it". >> >> this is probably correct - if you are running lighthttpd under a >> different >> user than you were running apache you could be blowing up on >> permission >> errors... >> >> -a >> -- >> ====================================================================== >> ========>> | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov >> | PHONE :: 303.497.6469 >> | When you do something, you should burn yourself completely, like a >> good >> | bonfire, leaving no trace of yourself. --Shunryu Suzuki >> ====================================================================== >> ========>> > > > -- > Ben Sinclair > ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >