Encoding error while installing rails on ruby 1.9.2

Discussion in 'Ruby' started by Bek Bek, Sep 14, 2010.

  1. Bek Bek

    Bek Bek Guest

    Hello everybody,

    I am making my first steps on Ruby on Rails. I have a very simple
    question. When I am trying to install rails (as well as every gem) I am
    getting this error:

    ERROR: While executing gem ... (Encoding::ConverterNotFoundError)
    code converter not found (UTF-16LE to IBM737)

    My Operating System is Microsoft Windows XP and I have installed Ruby
    1.9.2. With previous releases of Ruby (for example 1.8.7) everything is
    fine and gems installed successfully. But in version 1.9.2, when i try
    "gem install GEMNAME" in command prompt I get this error.

    Thank you in advance
    --
    Posted via http://www.ruby-forum.com/.
    Bek Bek, Sep 14, 2010
    #1
    1. Advertising

  2. Please be more specific. Which *exact* version of ruby 1.9.2 did you
    install, and where did you get it from? For example was it a Cygwin
    package, the rubyinstaller package, some other pre-compiled package, or
    did you build it yourself from source? In the latter case, what compiler
    did you use, and what options did you configure it with?

    Also, what output do you get from these commands?

    ruby -v
    ruby -e 'puts Encoding.find("locale")'
    ruby -e 'puts $:'
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Sep 14, 2010
    #2
    1. Advertising

  3. Bek Bek

    Bek Bek Guest

    I've installed "RubyInstaller 1.9.2-p0" from http://rubyinstaller.org/.
    The output I get from the commands you asked me is:

    ruvy -v:
    ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

    ruby -e 'puts Encoding.find("locale")':
    IBM737

    ruby -e 'puts $:':
    C:/Ruby192/lib/ruby/site_ruby/1.9.1
    C:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt
    C:/Ruby192/lib/ruby/site_ruby
    C:/Ruby192/lib/ruby/vendor_ruby/1.9.1
    C:/Ruby192/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
    C:/Ruby192/lib/ruby/vendor_ruby
    C:/Ruby192/lib/ruby/1.9.1
    C:/Ruby192/lib/ruby/1.9.1/i386-mingw32

    --
    Posted via http://www.ruby-forum.com/.
    Bek Bek, Sep 14, 2010
    #3
  4. Bek Bek

    Luis Lavena Guest

    On Sep 14, 5:57 am, Bek Bek <> wrote:
    > Hello everybody,
    >
    > I am making my first steps on Ruby on Rails. I have a very simple
    > question. When I am trying to install rails (as well as every gem) I am
    > getting this error:
    >
    > ERROR:  While executing gem ... (Encoding::ConverterNotFoundError)
    >     code converter not found (UTF-16LE to IBM737)
    >


    Why is your terminal IBM737?

    Can you change it with chcp to either 850 or 1251/1252?

    It seems that IBM737 do not have a Unicode converter match from/to
    UTF.

    If that works, please let us know.

    --
    Luis Lavena
    Luis Lavena, Sep 14, 2010
    #4
  5. Bek Bek

    Bek Bek Guest

    I changed it to 850 and it worked!!
    So that was the problem..
    Thank you very much!

    Luis Lavena wrote:
    > On Sep 14, 5:57�am, Bek Bek <> wrote:
    >> Hello everybody,
    >>
    >> I am making my first steps on Ruby on Rails. I have a very simple
    >> question. When I am trying to install rails (as well as every gem) I am
    >> getting this error:
    >>
    >> ERROR: �While executing gem ... (Encoding::ConverterNotFoundError)
    >> � � code converter not found (UTF-16LE to IBM737)
    >>

    >
    > Why is your terminal IBM737?
    >
    > Can you change it with chcp to either 850 or 1251/1252?
    >
    > It seems that IBM737 do not have a Unicode converter match from/to
    > UTF.
    >
    > If that works, please let us know.


    --
    Posted via http://www.ruby-forum.com/.
    Bek Bek, Sep 14, 2010
    #5
  6. kostas Bek wrote:
    > I changed it to 850 and it worked!!
    > So that was the problem..


    Or to give a different point of view: the problem is the fundamentally
    flawed design of ruby 1.9, which means that:

    (1) The same program, running on the same version of ruby and the same
    operating system, will work fine on one system but crash on another.

    (2) It is so complex that it is virtually impossible to build complete
    test coverage to prevent this sort of problem happening.

    Fortunately, there is an easy solution: use ruby 1.8.
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Sep 14, 2010
    #6
  7. On 14 September 2010 14:53, Brian Candler <> wrote:
    > kostas Bek wrote:
    >> I changed it to 850 and it worked!!
    >> So that was the problem..

    >
    > Or to give a different point of view: the problem is the fundamentally
    > flawed design of ruby 1.9, which means that:
    >
    > (1) The same program, running on the same version of ruby and the same
    > operating system, will work fine on one system but crash on another.
    >
    > (2) It is so complex that it is virtually impossible to build complete
    > test coverage to prevent this sort of problem happening.
    >
    > Fortunately, there is an easy solution: use ruby 1.8.
    > --


    Well, that is rather pessimist.

    AFAIK, with 1.8, he would just get unreadable characters in his
    terminal, and would have to figure himself what to do to resolve it.
    With 1.9, at least the error is shown and says the term's encoding is
    not compatible.

    But I agree, this kind of error just running `gem` is unexpected and
    non user-friendly.
    But he would anyway have to change one day to use other characters
    than pure ASCII in his term.

    P.S.: Why `gem` is trying to convert from UTF-16LE ?
    Benoit Daloze, Sep 14, 2010
    #7
  8. Benoit Daloze wrote:
    > AFAIK, with 1.8, he would just get unreadable characters in his
    > terminal


    Given that the error messages from ruby are themselves readable, it's a
    fair bet that IBM737 is at least ASCII-compatible.

    I'm pretty sure that rubygems under 1.8 would just have worked. After
    all, rubygems is a system utility. Its job is to fetch files and install
    them in the right places. "Encodings" don't help it to do that job, but
    they do make programs crash.

    > P.S.: Why `gem` is trying to convert from UTF-16LE ?


    I wondered that too.

    But more importantly, why is the locale's default_encoding significant?
    Is it reading files from the filesystem without specifying the locale
    (or binary mode)? If so that's a "bug" in rubygems, but it's the
    language which makes these bugs occur.
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Sep 14, 2010
    #8
  9. Bek Bek

    Luis Lavena Guest

    On Sep 14, 10:57 am, Brian Candler <> wrote:
    > Benoit Daloze wrote:
    > > AFAIK, with 1.8, he would just get unreadable characters in his
    > > terminal

    >
    > Given that the error messages from ruby are themselves readable, it's a
    > fair bet that IBM737 is at least ASCII-compatible.
    >


    This is what Roger Pack asked on Ruby core about IBM737

    > > P.S.: Why `gem` is trying to convert from UTF-16LE ?

    >
    > I wondered that too.
    >
    > But more importantly, why is the locale's default_encoding significant?
    > Is it reading files from the filesystem without specifying the locale
    > (or binary mode)? If so that's a "bug" in rubygems, but it's the
    > language which makes these bugs occur.


    Excellent question, seems to me that is trying to parse some gemspec
    contents (my guess)

    Complete output of "gem install xxx --debug -V" will be great to have
    when chcp is set to 737

    --
    Luis Lavena
    Luis Lavena, Sep 14, 2010
    #9
  10. Luis Lavena wrote:
    > On Sep 14, 10:57�am, Brian Candler <> wrote:
    >> Benoit Daloze wrote:
    >> > AFAIK, with 1.8, he would just get unreadable characters in his
    >> > terminal

    >>
    >> Given that the error messages from ruby are themselves readable, it's a
    >> fair bet that IBM737 is at least ASCII-compatible.
    >>

    >
    > This is what Roger Pack asked on Ruby core about IBM737
    >
    >> > P.S.: Why `gem` is trying to convert from UTF-16LE ?

    >>
    >> I wondered that too.
    >>
    >> But more importantly, why is the locale's default_encoding significant?
    >> Is it reading files from the filesystem without specifying the locale
    >> (or binary mode)? If so that's a "bug" in rubygems, but it's the
    >> language which makes these bugs occur.

    >
    > Excellent question, seems to me that is trying to parse some gemspec
    > contents (my guess)
    >
    > Complete output of "gem install xxx --debug -V" will be great to have
    > when chcp is set to 737


    Pardon if this considered to be high-jacking --
    I installed ruby-1.9.2p0 using ruby installer. This is the responses I
    get that was asked to the op.


    ruby -v:
    ruby 1.9.2p0 (2010-08-18) [i386-mingw32]


    ruby -e 'puts Encoding.find "local"'
    IBM437

    ruby -e 'puts $:'
    C:/Ruby192/lib/ruby/site_ruby/1.9.1
    C:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt
    C:/Ruby192/lib/ruby/vendor_ruby/1.9.1
    C:/Ruby192/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
    C:/Ruby192/lib/ruby/vendor_ruby
    C:/Ruby192/lib/ruby/1.9.1
    C:/Ruby192/lib/ruby/1.9.1/i386-msvcrt


    Is IBM437 an appropriate answer?
    If not, how do I correct it?

    Thank You



    --
    Posted via http://www.ruby-forum.com/.
    Bernard Kenik, Sep 14, 2010
    #10
  11. Bek Bek

    Luis Lavena Guest

    On Sep 14, 2:02 pm, Bernard Kenik <> wrote:
    >
    > Pardon if this considered to be high-jacking --
    > I installed ruby-1.9.2p0 using ruby installer.  This is the responses I
    > get that was asked to the op.
    >


    It fails? if not, then it is thread hijacking :p

    > Is IBM437 an appropriate answer?


    That depends. I prefer switch to latin (1252) due accented characters/
    unicode of Cucumber.

    > If not, how do I correct it?
    >


    A hidden trick, either you change in the current terminal by using
    "chcp XYZ" or editing the registry for permanent modification.

    http://github.com/aslakhellesoy/cucumber/wiki/Troubleshooting

    --
    Luis Lavena
    Luis Lavena, Sep 14, 2010
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ^CrazyCoder^
    Replies:
    3
    Views:
    7,257
    Terrence Benade
    Sep 15, 2003
  2. David
    Replies:
    1
    Views:
    489
    David
    Jul 19, 2004
  3. g_u_s
    Replies:
    5
    Views:
    94
    g_u_s
    Jun 2, 2005
  4. Josef 'Jupp' SCHUGT
    Replies:
    5
    Views:
    174
    Stephan Kämper
    Jan 24, 2006
  5. Jason Wong
    Replies:
    0
    Views:
    168
    Jason Wong
    Nov 20, 2007
Loading...

Share This Page