[Ironruby-core] IronRuby 1.1.1 IIRB failing

Johan Nilsson r.johan.nilsson at gmail.com
Fri Oct 29 03:58:10 EDT 2010


Hi,

I got a similar error after performing a clean install of IR 1.1.1 with the 
Visual Studio Tools under XP SP3 (Swedish with MUI), and might have a 
workaround (see below).

Orion Edwards wrote:
> After upgrading to IronRuby 1.1.1, I try run IIRB, and I get the
> following exception:

[snip]

> mscorlib:0:in `Throw': Unable to translate bytes [B8] at index 2 from
> specified code page to Unicode. (System::Text::Dec
> oderFallbackException)
>         from mscorlib:0:in `Fallback'
>         from mscorlib:0:in `InternalFallback'
>         from mscorlib:0:in `GetCharCount'
>         from mscorlib:0:in `GetCharCount'
>         from mscorlib:0:in `GetChars'
>         from
> C:/Dev/TEST/ruby/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:1845:in `[]'
>         from

[snip rest of callstack]

Here's what I got:
--------------------------
C:\foo\bar>iirb
mscorlib:0:in `Throw': Unable to translate bytes [84] at index 0 from 
specified code page to Unicode. (System::Text::DecoderFallback
Exception)
        from mscorlib:0:in `Fallback'
        from mscorlib:0:in `InternalFallback'
        from mscorlib:0:in `GetCharCount'
        from mscorlib:0:in `GetCharCount'
        from mscorlib:0:in `GetChars'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:1845:in `[]'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:1845:in `_rl_get_screen_size'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:1975:in `_rl_init_terminal_io'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:2491:in 
`readline_initialize_everything'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:3726:in `rl_initialize'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/rbreadline.rb:4720:in `readline'
        from C:/Program/IronRuby 
1.1/Lib/ruby/site_ruby/1.9.1/readline.rb:40:in `readline'
        from C:/Program/IronRuby 
1.1/Lib/ruby/1.9.1/irb/input-method.rb:115:in `gets'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:139:in 
`eval_input'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:273:in 
`signal_status'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:138:in 
`eval_input'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:188:in 
`[]'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:188:in 
`buf_input'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:103:in 
`getc'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/slex.rb:205:in 
`match_io'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/slex.rb:75:in 
`match'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:286:in 
`token'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:262:in 
`lex'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:233:in 
`each_top_level_statement'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:229:in 
`loop'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:229:in 
`each_top_level_statement'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:228:in 
`catch'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb/ruby-lex.rb:228:in 
`each_top_level_statement'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:155:in 
`eval_input'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:70:in `start'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:69:in `catch'
        from C:/Program/IronRuby 1.1/Lib/ruby/1.9.1/irb.rb:69:in `start'
        from C:/Program/IronRuby 1.1/bin/irb:13
--------------------------

The funny thing was, that if I opened a command prompt as an administrator 
(e.g. runas /user:<admin> cmd) and ran iirb it worked. I originally thought 
it had something to do with privileges (and it still might), but what seemed 
to work around the problem was resetting the Command Window size and buffer 
size(!) for the current user to the default values of 80x25, 80x300 (the 
_rl_get_screen_size in the stack trace gave me the hint):

---------------------------
C:\foo\bar>iirb
irb(main):001:0> puts 'Hello World'
Hello World
=> nil
irb(main):002:0>
---------------------------

Good luck / Johan




More information about the Ironruby-core mailing list