[ANN] Utility Belt 1.0.6 - Rails bug workaround

G

Giles Bowkett

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:

http://gilesbowkett.blogspot.com/2007/12/utility-belt-vs-rails.html

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

--
Giles Bowkett

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

Xavier Noria

(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.
 
B

Bob Hutchison

Hi,

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?

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
 
G

Giles Bowkett

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 Edwards, 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
(e-mail address removed).

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


--
Giles Bowkett

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top