在Ruby 1.9.3 IRB中无法进入Umlauts [英] Can't enter Umlauts in Ruby 1.9.3 IRB

查看:135
本文介绍了在Ruby 1.9.3 IRB中无法进入Umlauts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ruby 1.9.3的IRB与Mac OS 10.7.3
中遇到了非常奇怪的行为当我尝试输入Umlaut时,它在提示符中被转义,看起来像这样(我输入了ü

  irb(main):001:0> \U + FFC3\U + FFBC

这是什么超级奇怪:

  irb(main):001:0> \U + FFC3\U + FFBC.length 
=> 0

当然,该角色也不会显示:

  irb(main):001:0> \U + FFC3\U + FFBC
=>

有谁知道这里发生了什么或如何解决这个问题?

解决方案

Victor Moroz没有给出确定的答案,但他的链接让我得到一个解决方案(thx!):



我忘了提到:





在我的例子中,我解决这个问题的是重新编译,这次将ruby更新为更新版本的readline(6.2。在我的情况下,我安装了自制软件。



它采取的步骤是:

 CP $ L $ / $ / $ / $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ /readline/6.2.2/lib/ 
$ curl https://raw.github.com/gist/1688857/rbenv.sh | sh&& rbenv全球1.9.3-p125-perf


I am experiencing very strange behavior in Ruby 1.9.3's IRB with Mac OS 10.7.3 When I try to enter an Umlaut, it's escaped in the prompt and looks like this (I entered "ü" on the keyboard)

irb(main):001:0> "\U+FFC3\U+FFBC"

What's super strange is this:

irb(main):001:0> "\U+FFC3\U+FFBC".length
=> 0

Of course, the character isn't displayed either:

irb(main):001:0> "\U+FFC3\U+FFBC"
=> ""

Does anyone know what's going on here or how to fix this?

解决方案

Victor Moroz didn't quite give the definitive answer but his link led me to a solution (thx!):

I forgot to mention:

What I then did to solve this problem in my case was to recompile, this time pointing ruby to a more recent version of readline (6.2.2 in my case) that I installed with homebrew.

The steps it took were:

$ brew install readline
$ export CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include
$ export LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib/
$ curl https://raw.github.com/gist/1688857/rbenv.sh | sh && rbenv global 1.9.3-p125-perf

这篇关于在Ruby 1.9.3 IRB中无法进入Umlauts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆