A
Andre Willik valenti
Hello all,
I'm new to Ruby and I've been taking a look at the "Getting Started"
stuff from ruby-lang.org. I found the following example from
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/:
class Fixnum
# You can, but please don't do this
def +( other )
self - other
end
end
If I run this code using the ruby command, it's fine. However, on irb, I
get the following error:
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:8446:in
`_rl_find_next_mbchar': undefined method `force_encoding' for
nil:NilClass (NoMethodError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1692:in
`block in expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1676:in
`each'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1676:in
`expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1765:in
`rl_expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1790:in
`rl_set_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:4718:in
`readline'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/readline.rb:40:in
`readline'
from C:/Ruby192/lib/ruby/1.9.1/irb/input-method.rb:115:in `gets'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:139:in `block (2 levels)
in eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:138:in `block in
eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `call'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in
`buf_input'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:103:in `getc'
from C:/Ruby192/lib/ruby/1.9.1/irb/slex.rb:205:in `match_io'
from C:/Ruby192/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:286:in `token'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:262:in `lex'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:233:in `block (2
levels) in each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in
each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in
`each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `catch'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `start'
from C:/Ruby192/bin/irb:12:in `<main>'
And then irb abruptly closes. I'm using Windows 7 Professional, ruby
1.9.2p0 (2010-08-18) [i386-mingw32] and irb 0.9.6(09/06/30).
I've done some searching about this problem, but couldn't find anything.
I apologize in case it is a known issue.
Regards,
Andre
I'm new to Ruby and I've been taking a look at the "Getting Started"
stuff from ruby-lang.org. I found the following example from
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/:
class Fixnum
# You can, but please don't do this
def +( other )
self - other
end
end
If I run this code using the ruby command, it's fine. However, on irb, I
get the following error:
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:8446:in
`_rl_find_next_mbchar': undefined method `force_encoding' for
nil:NilClass (NoMethodError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1692:in
`block in expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1676:in
`each'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1676:in
`expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1765:in
`rl_expand_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:1790:in
`rl_set_prompt'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rbreadline.rb:4718:in
`readline'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/readline.rb:40:in
`readline'
from C:/Ruby192/lib/ruby/1.9.1/irb/input-method.rb:115:in `gets'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:139:in `block (2 levels)
in eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:138:in `block in
eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `call'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in
`buf_input'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:103:in `getc'
from C:/Ruby192/lib/ruby/1.9.1/irb/slex.rb:205:in `match_io'
from C:/Ruby192/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:286:in `token'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:262:in `lex'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:233:in `block (2
levels) in each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in
each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from C:/Ruby192/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in
`each_top_level_statement'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `catch'
from C:/Ruby192/lib/ruby/1.9.1/irb.rb:69:in `start'
from C:/Ruby192/bin/irb:12:in `<main>'
And then irb abruptly closes. I'm using Windows 7 Professional, ruby
1.9.2p0 (2010-08-18) [i386-mingw32] and irb 0.9.6(09/06/30).
I've done some searching about this problem, but couldn't find anything.
I apologize in case it is a known issue.
Regards,
Andre