# Win XP / Ferret & Acts\_as\_ferret .dump problem

**URL:** <https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602>\
**Category:** Ferret\
**Created:** [September 22, 2006, 6:33am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602 "2006-09-22T06:33:31Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 22, 2006, 6:33am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/1 "2006-09-22T06:33:31Z")

</div>

Hey,

Has anyone managed to bypass or fix the ferret’s .dump method problem?  
When I include acts\_as\_ferret my whole rails app just blows up because  
of Ferret’s .dump method. Ex:

* * *

## print “\t hello”.dump \>\> “\t hello”\>Exit code: 0

* * *

## require ‘ferret’ print “\t hello”.dump \>\> " hello"(NUL char)\>Exit code: 0

Essentially this breaks erb and thus Rails template engines dies. I’ve  
found topics on this issue before and best recommendation I’ve found is  
‘remove all tabs in your rhtml files’. Now, first off it fails even on  
non-tab characters in my case, so this is a no go… (Not to mention  
that this is hardly a solution)

I’m running:  
ruby 1.8.4 (2006-04-14) [i386-mswin32]  
rails 1.1.6  
ferret 0.10.4 (10.6 and all the rest all have same issue)

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 22, 2006, 3:11pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/2 "2006-09-22T15:11:12Z")

</div>

Hi!

please see  
[http://rubyforge.org/tracker/?func=detail&aid=3837&group\_id=12&atid=133](http://rubyforge.org/tracker/?func=detail&aid=3837&group_id=12&atid=133)  
for extensive info on this issue.

Apparently this doesn’t have to do with Ferret itself, but with you  
using  
another ruby version than the one the Ferret binary extension was built  
against. I don’t know, however, with which Ruby version the win32 gem is  
built.

Jens

On Fri, Sep 22, 2006 at 06:33:31AM +0200, Ilya G. wrote:

> * * *
> 
> I’m running:  
> ruby 1.8.4 (2006-04-14) [i386-mswin32]  
> rails 1.1.6  
> ferret 0.10.4 (10.6 and all the rest all have same issue)
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Ferret-talk mailing list  
> removed\_email\_address@domain.invalid  
> [http://rubyforge.org/mailman/listinfo/ferret-talk](http://rubyforge.org/mailman/listinfo/ferret-talk)

–  
webit! Gesellschaft für neue Medien mbH [www.webit.de](http://www.webit.de)  
Dipl.-Wirtschaftsingenieur Jens Krämer removed\_email\_address@domain.invalid  
Schnorrstraße 76 Tel +49 351 46766 0  
D-01069 Dresden Fax +49 351 46766 66

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 22, 2006, 3:17pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/3 "2006-09-22T15:17:13Z")

</div>

On 9/22/06, Ilya G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> I’m running:  
> ruby 1.8.4 (2006-04-14) [i386-mswin32]  
> rails 1.1.6  
> ferret 0.10.4 (10.6 and all the rest all have same issue)

Hi Ilya,

Firstly, String#dump isn’t a Ferret method. Secondly, I have no idea  
why this is occuring. The error isn’t happening in Ferret code so it  
is difficult for me to diagnose the problem. I didn’t realize that it  
was this easy to replicate the problem though so I’ll have another  
look at it tonight. Don’t get your hopes up though. It isn’t only  
Ferret that is causing this problem so I’m not goig to count out the  
possibility that the bug is in Ruby of VC6.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 23, 2006, 3:10am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/4 "2006-09-23T03:10:47Z")

</div>

Dave and Tim…

I tried running all ms-win versions of ferret on 1.8.5 / 1.8.4-20 and  
even 1.8.2, all of them resulted in the same error. It’s absurd, I don’t  
understand why you guys are unable to reproduce this error. (I did  
restart and all that jazz… with each reinstall of ruby etc).

Mind you, I only tried this on my main development machine so I will see  
if I can reproduce this on my laptop in a second. From my readings on  
this problem, RMagick seems to have had the same bug because it  
overwrote the default .dump method. Hence I assumed that Ferret is doing  
the same.

I’ll let you guys know on the results of my experiment…

Ilya

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 23, 2006, 3:31am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/5 "2006-09-23T03:31:51Z")

</div>

Same problem, 1.8.4-20 stable…

C:\Documents and Settings\Ilya\>irb  
irb(main):001:0\> “\t\tabcd”.dump  
=\> “”\t\tabcd""  
irb(main):002:0\> require ‘ferret’  
=\> true  
irb(main):003:0\> “\t\tabcd”.dump  
=\> “” abcd"\000\000"  
irb(main):004:0\>

Null chars, spaces… Oi. Am I missing something something in my install?  
I’m just installing the one-click ruby and then ‘gem install ferret’.  
Any dependencies I’m not aware of?

Ilya

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 22, 2006, 10:40pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/6 "2006-09-22T22:40:28Z")

</div>

On 9/22/06, Jens K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Jens

After looking into this myself I think Tim must be right, although for  
some reason I’m having trouble replicating the error here, even when I  
do install different versions of Ruby. Anyway, I will endeavor to  
always build Ferret with the latest stable version of One-Click Ruby.  
Currently that is 1.8.4-20 stable. If you are still running into this  
problem and you have that version of Ruby installed the let me know.  
Make sure you try restarting your computer first though. I think that  
may be why I couldn’t replicate the problem.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 23, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/7 "2006-09-23T18:29:09Z")

</div>

Thanks Dave…

I’ve finally managed to find a version of Ruby (1.8.2-15) which passes  
the .dump test above. Using:  
[http://rubyforge.org/frs/?group\_id=167](http://rubyforge.org/frs/?group_id=167)

Now, the headache is… I can’t find an RMagick gem to go with it (which  
I need for my Rails app) - the rmagick repo only has gems for 1.8.4 and  
1.8.5. Sigh. 🙂

I know this won’t be a problem when I deploy my app, but it totally  
screws up my ability to development an app on XP.

🙂

Ilya

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [September 23, 2006, 12:45pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/8 "2006-09-23T12:45:12Z")

</div>

On 9/23/06, Ilya G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> overwrote the default .dump method. Hence I assumed that Ferret is doing  
> the same.

Hi Ilya,

Actually, if you look at that link that Jens posted, RMagick doesn’t  
overwrite the String#dump method;

```
"Of course RMagick doesn't intentionally alter String.dump,
    and your example doesn't even use RMagick for anything."

```

And neither does Ferret, although I can certainly see why people would  
think it did. Believe me, I understand your frustration. If I could  
find the problem I would. I’ll give it a try on my laptop and see if I  
can reproduce the problem there. Perhaps you could try asking on the  
One-Click Ruby list or on the ruby-talk list.

I’ll keep trying to find the problem at this end too.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 9:03am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/9 "2006-10-16T09:03:20Z")

</div>

On 10/16/06, Brent S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Any updates?  
> Thanks  
> Brent

Afraid not. But it is interesting that the problem is not consistent  
across all Windows machines. I still haven’t been able to reproduce  
the problem here.

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/10 "2006-10-16T15:42:13Z")

</div>

Ok thanks…  
On that note, does anyone have a quick method of removing all tabs and  
unwelcome characters from a rails app?  
David B. wrote:

> On 10/16/06, Brent S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Any updates?  
> > Thanks  
> > Brent
> 
> Afraid not. But it is interesting that the problem is not consistent  
> across all Windows machines. I still haven’t been able to reproduce  
> the problem here.

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 2:07am UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/11 "2006-10-16T02:07:41Z")

</div>

Hello Ilya and Dave,  
Have you figured out what is causing this issue?  
It is happening for me with acts\_as\_ferret and rmagick.  
My rails app works great on some windows boxes, but on my 2003 server it  
gives me the nondecript EBADF error whenever I hit any controller  
functions that use ferret or rmagick.  
Initially it would not load on any of my windows boxes, but the quick  
workaround of modifying base.rb to replace tabs with spaces worked.  
Unfortunately however the app is still crapping out whenever I hit  
rmagick or ferret functions on the 2003 box.  
Any updates?  
Thanks  
Brent

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/12 "2006-10-16T17:31:14Z")

</div>

Steven H. wrote:

> Can you post your changes to base.rb? I’d like to give that a try.
> 
> Thanks,  
> Steve

sure:  
actionpack-1.12.1/lib/action\_view/base.rb  
modify compile\_template to begin with

template=template.gsub(/\t/," ")

It completely fixed the issue on one of my win systems,  
but on another one of them (both 2003), it doesnt work.

This may cause many other issues than it fixes however so I would label  
it a hack for now. I found this fix online somewhere, but I can’t find  
it anymore.

Good luck.  
Brent

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/13 "2006-10-16T20:12:42Z")

</div>

Interesting solution Brent…

I actually just ended up installing VMWare / Fedora Core 5 and doing my  
development from there. No problems on \*nix distributions. 🙂

It would be really nice if someone could resolve this problem though!  
(Once and for all)

Cheers,  
Ilya

P.S. Running ferret on [http://www.graphics-world.com](http://www.graphics-world.com) - loving it! 🙂

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 8:37pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/14 "2006-10-16T20:37:51Z")

</div>

Thanks, I’ll report back success or failure with this.

Steve

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [October 16, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/15 "2006-10-16T17:16:20Z")

</div>

Can you post your changes to base.rb? I’d like to give that a try.

Thanks,  
Steve

---

<div class="post-metadata">

**Author:** ![igrigorik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e68b1a/32.png) [@igrigorik](https://www.ruby-forum.com/u/igrigorik)\
**Post date:** [January 29, 2007, 9:28pm UTC](https://www.ruby-forum.com/t/win-xp-ferret-acts-as-ferret-dump-problem/69602/16 "2007-01-29T21:28:04Z")

</div>

Steven H. wrote:

> Thanks, I’ll report back success or failure with this.
> 
> Steve

All,

Is the hack proposed in the thread above is the only solution ? Or do we  
have had any public fixes available? Please revert if there are

Thanks  
Amit
