# Utility Belt 1.0.6 - Rails bug workaround

**URL:** <https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375>\
**Category:** Ruby\
**Created:** [December 17, 2007, 6:54am UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375 "2007-12-17T06:54:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 6:54am UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/1 "2007-12-17T06:54:52Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 6:56am UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/2 "2007-12-17T06:56:37Z")

</div>

(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](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 7:54am UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/3 "2007-12-17T07:54:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 1:59pm UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/4 "2007-12-17T13:59:27Z")

</div>

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/](http://www.recursive.ca/so/)  
Recursive Design Inc. – weblog at  
[http://www.recursive.ca/hutch](http://www.recursive.ca/hutch)  
[http://www.recursive.ca/](http://www.recursive.ca/) – works on  
[http://www.raconteur.info/cms-for-static-content/home/](http://www.raconteur.info/cms-for-static-content/home/)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/5 "2007-12-17T17:18:05Z")

</div>

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](http://screencast.com/t/k6Nlk8Q0Csy)

Here’s a grab of the stacktrace:

[![](http://s3.amazonaws.com/giles/rails_bug_stacktrace.png) ](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  
removed\_email\_address@domain.invalid.

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

–  
Giles B.

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

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [December 17, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/utility-belt-1-0-6-rails-bug-workaround/123375/6 "2007-12-17T18:48:57Z")

</div>

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](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/](http://www.recursive.ca/so/)  
Recursive Design Inc. – weblog at  
[http://www.recursive.ca/hutch](http://www.recursive.ca/hutch)  
[http://www.recursive.ca/](http://www.recursive.ca/) – works on  
[http://www.raconteur.info/cms-for-static-content/home/](http://www.raconteur.info/cms-for-static-content/home/)
