Unicode characters in Ruby 1.9.3 IRB with RVM
Asked Answered
M

3

8

Update: I found almost exact similar question, yet it has slightly different prerequisites and thus doesn't help much.

Given:

  • MacOS Lion 10.7.3
  • rvm 1.14.2
  • ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]

    Ruby was installed with the following line:

    rvm install 1.9.3 --with-readline-dir=/usr/local/Cellar/readline/6.2.2/

When I fire up irb or rails c and start typing unicode characters, I get:

\U+FFD0\U+FFBF\U+FFD1\U+FFD0\U+FFB8\U+FFD0\U+FFBC\U+FFD0\U+FFB5\U+FFD1

How do I get unicode characters displayed correctly when typing on Ruby/Rails consoles?

P.S. Typing same characters in bash session of Terminal result in proper output.

P.P.S. Just to be clear -- in console I am typing russian characters: are they considered unicode symbols?

Menchaca answered 20/6, 2012 at 9:9 Comment(0)
T
21

RVM has issues with readline installed via homebrew. This gist worked perfectly for me:

$ rvm get latest
$ rvm pkg install readline
$ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr

Instead of install you can use reinstall.

Toxemia answered 20/6, 2012 at 9:23 Comment(1)
That worked for me, even without the --with-readline-dir option. The "pkg install" part seems to be what does it.Haphtarah
C
3

only rvm reinstall all --force helped me

Corby answered 23/10, 2012 at 11:59 Comment(0)
H
0

Other solution would be using http://railsinstaller.org it already provides everything compiled for Ruby and Rails, I was working hard to solve all the libraries compilation and provide one package.

Heddi answered 20/6, 2012 at 14:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.