Utility Belt 1.0.6 - Rails bug workaround

Hi all, 24 hours has elapsed, so it’s time for another release of
Utility Belt!

In this episode, our intrepid heroes discover a shocking secret!

Rails has a bug which clashes with Utility Belt:

v1.0.6 bravely and dashingly sidesteps this issue without responsibly
or intelligently fixing it. (Maybe that part happens next episode.)


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

(To clarify, this release of Utility Belt doesn’t trigger the bug in
Rails any more, but the bug in Rails still exists. Hoping to find a
fix soon.)


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On Dec 17, 2007, at 6:35 AM, Giles B. wrote:

(To clarify, this release of Utility Belt doesn’t trigger the bug in
Rails any more, but the bug in Rails still exists. Hoping to find a
fix soon.)

Hi Giles, I put

 CONSTANT_FROM_IRBRC = 7

in ~/.irbrc, and the constant is visible from the console but not from
a controller in a regular request.

Can you show a minimal way to get ~/.irbrc accidentally loaded by an
applicaction?

– fxn

PS: I reply here because comments are closed in the blog.

Hi,

On 17-Dec-07, at 1:52 AM, Xavier N. wrote:

in ~/.irbrc, and the constant is visible from the console but not
from a controller in a regular request.

Can you show a minimal way to get ~/.irbrc accidentally loaded by an
applicaction?

I’m not seeing this problem either. I’m using Rails 2.0.1 and dozens
of gems.

I’ve used ack to scan all (I think) of the code and the only
occurrences of ‘irb’ are related to consoles and breakpoints. I’ve put
some code in my .irbrc file and that is not being run from inside rails.

Are you sure Rails is the culprit here?

Cheers,
Bob

– fxn

PS: I reply here because comments are closed in the blog.


Bob H. – tumblelog at
http://www.recursive.ca/so/
Recursive Design Inc. – weblog at
http://www.recursive.ca/hutch
http://www.recursive.ca/ – works on
http://www.raconteur.info/cms-for-static-content/home/

Hi Xavier, hi Bob, the bug is obscure and weird and I do not have any
test cases yet. I know for a fact it’s in Rails. See the mail about
“Constant already initialized” errors - basically, I saw it before
with code that only existed in my .irbrc and was not in any other
file anywhere on my system. But that was months ago. It went away on
its own and I don’t know why. I’ll post details on my blog at some
point today.

I’m not seeing it on my own installs either, but here’s a screencast
of the bug in action:

http://screencast.com/t/k6Nlk8Q0Csy

Here’s a grab of the stacktrace:

http://s3.amazonaws.com/giles/rails_bug_stacktrace.png

(I’ll put those on the blog also. Actually, the screencast is already
linked, but it’s in one of several posts. Orion E., who I quote
in the latest post, stopped his Rails apps from crashing on him
unexpectedly by removing the “edit” method in Utility Belt, see the
latest post and his comment on Raganwald’s blog for more.)

The relevant lib is ActiveSupport::Dependencies, it has a set of files
to load and for some reason it’s gathered .irbrc into that list,
either at or around line 488. That’s pretty much all I know at this
point. The bug’s only been conclusively spotted in versions prior to
2.0, but the relevant code in 2.0’s active_support/lib/dependencies.rb
is in most cases identical.

Re: blog comments, this is a friendly e-mail list where peer pressure
will compel us all to be decent human beings. It takes energy and luck
to get that in an online community - plenty of online communities
don’t have it - and the blog format doesn’t have the necessary
features to even encourage it, so I will never re-enable comments on
my blog. Blog comments are a bug. They often work out due to luck, but
the design is terrible and makes all kinds of unscalable assumptions.

But definitely get in touch with any and all ideas, I do appreciate
it. There 's also a Utility Belt list, it’s
[email protected]

(http://rubyforge.org/mailman/listinfo/utilitybelt-tinkering)


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On 17-Dec-07, at 11:07 AM, Giles B. wrote:

I’m not seeing it on my own installs either, but here’s a screencast
of the bug in action:

http://screencast.com/t/k6Nlk8Q0Csy

I’d be curious to see what’s in that sv script.

Cheers,
Bob


Bob H. – tumblelog at
http://www.recursive.ca/so/
Recursive Design Inc. – weblog at
http://www.recursive.ca/hutch
http://www.recursive.ca/ – works on
http://www.raconteur.info/cms-for-static-content/home/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs