On Dec 16, 1:48 am, Manfred Stienstra <[EMAIL PROTECTED]> wrote:
> On Dec 16, 2007, at 1:29 AM, giles bowkett wrote:
>
> > He has a Rails app running; he installs my gem; he restarts his
> > server; he gets an error in one of the my_model_url methods, i.e.,
> > model_path(my_model) fails for him as a result of installing a gem
> > which is only required in his .irbrc, and not anywhere in his
> > application.
>
> Actually, the error isn't in Rails itself as far as I can tell. As you  
> can see in the screencast @module becomes nil, which could point to  
> the fact that it's never set in the controller, which is  
> understandable as utility belt probably uses a lot magic to create  
> stuff like the finder shortcuts.

OK, I don't get that at all. He's got the page working; he loads
Utility Belt; the page breaks. The fact that he had the page working
indicates he probably did have @module set to a value before that
point. He unloads Utility Belt and reloads the page with no difficult,
which means that @module probably gets a value again.

Utility Belt doesn't really use very much magic in the finder
shortcuts. It does use a Proc to load *after* IRB loads, but the
finder shortcuts themselves don't even use reflection, they just glob
the app/models dir. That code comes from Mike Clark's blog so it's
really easy to check:

http://clarkware.com/cgi/blosxom/2007/09/03

I think it's fair to say the error might be in Rails when you're
loading an irrelevant gem and seeing a previously-working page
suddenly fail.

> It's possible that it has something to do with IRB and reading  
> the .irbrc, but as far as I know it's only used through ruby-debug now.

Yes, I agree with you there.

> Can you find out...
> - ...what version of Rails he's using.
> - ...what is in his .irbrc.
> - ...what happens when he removes the .irbrc.
>
> And after that create a ticket about it?

I never do that kind of thing. I'm going to find out how it broke, and
fix it, or I'm going to tell people to watch out for the bug in Rails.
Sorry. I was just hoping I could get some guidance towards which part
of the internals might contain the bug. But it's cool, I'll find it.
Thanks anyway.

Thanks especially (both you and Salmon) for the breakpoint/ruby-debug
tip.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to