[Eric] Ruby error with $stdin.gets
Eric
tidris769 at cox.net
Sun Apr 18 16:40:06 BST 2010
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/DebugClientBaseModule.rb:172:in
`unhandled_exception': private method `sub' called for nil:NilClass (NoMethodError)
from /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseModule.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/DebugClientBaseModule.rb:619:in
`eventLoop'
from /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseModule.rb:595:in
`interact'
from /usr/lib/python2.6/dist-packages/eric4/DebugClients/Ruby/DebugClientBaseModule.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.
More information about the Eric
mailing list