Ilya Grigorik
2006-Sep-22 04:33 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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) -- Posted via http://www.ruby-forum.com/.
Jens Kraemer
2006-Sep-22 09:17 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
Hi! please see 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 Grigorik wrote:> 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) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk-- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
David Balmain
2006-Sep-22 09:55 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
On 9/22/06, Ilya Grigorik <ilya at fortehost.com> wrote:> 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)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
David Balmain
2006-Sep-22 17:11 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
On 9/22/06, Jens Kraemer <kraemer at webit.de> wrote:> Hi! > > please see > 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. > > > JensAfter 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
Ilya Grigorik
2006-Sep-23 01:10 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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 -- Posted via http://www.ruby-forum.com/.
Ilya Grigorik
2006-Sep-23 01:31 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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 -- Posted via http://www.ruby-forum.com/.
David Balmain
2006-Sep-23 06:47 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
On 9/23/06, Ilya Grigorik <ilya at fortehost.com> wrote:> 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.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
Ilya Grigorik
2006-Sep-23 16:29 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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 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 -- Posted via http://www.ruby-forum.com/.
Brent Salo
2006-Oct-16 00:07 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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 -- Posted via http://www.ruby-forum.com/.
David Balmain
2006-Oct-16 07:03 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
On 10/16/06, Brent Salo <brent.salo at scgcanada.com> wrote:> 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 > BrentAfraid 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.
Ok thanks... On that note, does anyone have a quick method of removing all tabs and unwelcome characters from a rails app? David Balmain wrote:> On 10/16/06, Brent Salo <brent.salo at scgcanada.com> 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.-- Posted via http://www.ruby-forum.com/.
Steven Hammond
2006-Oct-16 14:02 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
Can you post your changes to base.rb? I''d like to give that a try. Thanks, Steve On Oct 15, 2006, at 8:07 PM, Brent Salo wrote:> 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk
Steven Hammond wrote:> Can you post your changes to base.rb? I''d like to give that a try. > > Thanks, > Stevesure: 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 -- Posted via http://www.ruby-forum.com/.
Steven Hammond
2006-Oct-16 17:56 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
Thanks, I''ll report back success or failure with this. Steve On Oct 16, 2006, at 11:31 AM, Guest wrote:> Steven Hammond 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 > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk
Ilya Grigorik
2006-Oct-16 18:12 UTC
[Ferret-talk] Win XP / Ferret & Acts_as_ferret .dump problem
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 - loving it! :) -- Posted via http://www.ruby-forum.com/.
Steven Hammond wrote:> Thanks, I''ll report back success or failure with this. > > SteveAll, 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 -- Posted via http://www.ruby-forum.com/.