[Eric] Ruby error with $stdin.gets

detlev detlev at die-offenbachs.de
Sun Apr 18 17:11:48 BST 2010


Hi,

can you send a patch because I am not very familiar with Ruby (it's a long 
time I did the backend).

Detlev

On Sonntag, 18. April 2010, Eric wrote:
> I am trying to use eric4 4.4.2 with ruby scripts and the ones that use
>  $stdin.gets fail under eric4. This seems to be because under eric4 $stdin
>  is of type AsyncFile instead of the normal type IO and unfortunately
>  AsyncFile lacks a public gets method, For example, when I run a ruby
>  script with this single line in it:
> 
> $stdin.gets
> 
> I get the following error info on the eric4 Shell window:
> ruby 1.8.7 (2009-06-12) [i486-linux] on g2s, No Qt-Version
> 
> >>> /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBas
> >>>eModule.rb:172:in
> 
> `unhandled_exception': private method `sub' called for nil:NilClass
>  (NoMethodError) from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseMo
> dule.rb:343:in `handleLine'
>      from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/AsyncIO.rb:73:in
>  `readReady' from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseMo
> dule.rb:619:in `eventLoop'
>      from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseMo
> dule.rb:595:in `interact'
>      from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseMo
> dule.rb:1172:in `main'
>      from
>  /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClient.rb:44
> 
> This looks like an eric4 bug to me. I am currently working around this
>  problem by using $stdin.readline instead of $stdin.gets.
> 
> 
> 
> _______________________________________________
> Eric mailing list
> Eric at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/eric
> 


-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the Eric mailing list