[Rails] App behaves differently on Apache and Webrick (Rails bug?)

John Johnson johnatl at mac.com
Thu Mar 3 01:01:15 GMT 2005


Okay, I fixed this, but I would think it's an undocumented feature in 
dependencies.rb (or elsewhere).

I set a breakpoint here (dependencies.rb, around line 56)
     def const_missing(class_id)
       begin
breakpoint
        require_or_load(class_id.to_s.demodulize.underscore)

in IRB I did:
class_id.to_s.demodulize.underscore
"merge"
so far so good.
I tried:
require_or_load(class_id.to_s.demodulize.underscore)
and it barfed with a load error on another module of mine, 
gkntag/cutparts, which is required in merge.rb.
As I said, this runs fine under Webrick.
I changed the requires in merge.rb to:
require RAILS_ROOT + 'gkntag/cutparts'
require RAILS_ROOT + 'gkntag/filepair'

and it works fine under Apache and Webrick. My partial directory 
structure:

vcon/
	gkntag/
		cutparts.rb
		filepair.rb
	app/
		models/
			merge.rb

Regards,
   JJ

On 02-Mar-2005, at 17:31, John Johnson wrote:

> Anyone?
>
> I can post code, but don't see the need since it works okay with 
> Webrick. I also just installed the app on WindowsXP running XAMPP, and 
> get the same results with Apache. Haven't tried Webrick on that box, 
> but will shortly.
>
> Thanks in advance!
>
> Regards,
>   JJ
>
> On 01-Mar-2005, at 20:17, John Johnson wrote:
>
>> When running on the Webrick server (script/server), my app works 
>> fine. When running on Apache 2.0.52, I get the dreaded 'unitialized 
>> constant Merge' error. Merge is the name of my model, the controller 
>> is MergesController.
>>
>> The deadline looms, any help appreciated!
>>
>> Thanks!
>>
>> Regards,
>>   JJ
>>
>> _______________________________________________
>> Rails mailing list
>> Rails at lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



More information about the Rails mailing list