Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

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

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What are the problem?