LoginSignup
2
2

More than 5 years have passed since last update.

rails console(irb)でASCII以外のUnicodeの文字列がコード表記になってしまう時の対処法

Posted at

Rails consoleでäと打つと、\U+FFC3\U+FFA4 が表示されてしまう。当然日本語もハングルもダメ。

対策

readline が ruby のコンパイル時に使われてないのが原因らしい。なのでreadlineを指定して再インストールする。 readlineのディレクトリは環境に合わせてかえてください。特にバージョン6.2.4は変わってる可能性が高し。

CONFIGURE_OPTS="--with-readline-dir=/usr/local/Cellar/readline/6.2.4/" rbenv install 2.0.0-p247
rbenv: /Users/ironsand/.rbenv/versions/2.0.0-p247 already exists
continue with installation? (y/N) y

参考

How to input Unicode character in Rails console? - Stack Overflow
http://stackoverflow.com/questions/19857471/how-to-input-unicode-character-in-rails-console?noredirect=1#comment29535126_19857471

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2