安装Ruby 1.9.3遇到问题

3
我想安装 Ruby 1.9.3,目前已安装 Ruby 1.9.2。
操作系统为 Mac Os X,Xcode 版本为 4.3.2,我已删除所有旧版 Xcode。我阅读了很多文章并尝试了https://dev59.com/92kw5IYBdhLWcg3wx9eC#9651747中详细介绍的步骤。
我遇到的错误如下:
ruby-1.9.3-p125 - #fetching 
ruby-1.9.3-p125 - #extracted to /Users/kai/.rvm/src/ruby-1.9.3-p125 (already extracted)
WARN: Patch 'xcode-debugopt-fix-r34840.diff' not found.
ruby-1.9.3-p125 - #configuring 
ruby-1.9.3-p125 - #compiling 
ERROR: Error running 'make ', please read /Users/kai/.rvm/log/ruby-1.9.3-p125/make.log
ERROR: There has been an error while running make. Halting the installation.

错误日志似乎指向了这个问题。
compiling readline.c
readline.c: In function ‘username_completion_proc_call’:
readline.c:1499: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1499: error: (Each undeclared identifier is reported only once
readline.c:1499: error: for each function it appears in.)
make[2]: *** [readline.o] Error 1
make[1]: *** [ext/readline/all] Error 2
make: *** [build-ext] Error 2

有什么想法吗?
4个回答

7

我也遇到了同样的错误。我通过使用以下命令解决了它:

rvm reinstall 1.9.3 --with-readline-dir=/usr/local/Cellar/readline/6.2.4

只需使用Homebrew安装的readline即可,更多信息请参见https://rvm.io/packages/readline/


3

1
你安装了readline包吗?
尝试使用最新的RVM稳定分支安装1.9.3-p194(而不是p125),它不需要上面输出中提到的osx补丁。请仔细按照我在文章中描述的步骤操作,如果仍然有问题,请提供您运行的命令(除了输出之外)。

1
太棒了,那个起作用了。似乎1.9.3-p125对我来说不起作用。非常感谢。 - Kaiwei Chen

-1

使用http://rvm.io,这可能是今天在计算机上安装Ruby最简单和最好的方法。其他人可能会建议rbenv或homebrew或其他包管理器。那些也可能很好。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接