当我尝试在雪豹上安装
Ruby 1.9.2时:
rvm install 1.9.2
我得到以下内容:
ERROR: Error running 'make ',please read /Users/mary/.rvm/log/ruby-1.9.2-p180/make.log ERROR: There has been an error while running make. Halting the installation.
所以,我查看了make.log.结尾如下:
readline.c: In function ‘username_completion_proc_call’: readline.c:1386: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:1386: error: (Each undeclared identifier is reported only once readline.c:1386: error: for each function it appears in.) make[1]: *** [readline.o] Error 1 make: *** [mkmain.sh] Error 1
我已经咨询了这个问题的其他答案,并做了一切建议:
>安装了XCode.
> .bash_profile的结尾添加了以下行:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
我已经尝试更新readline,但无论如何,我继续收到有关运行’make’的错误消息.
rvm信息的输出如下:
system: system: uname: "Darwin mary-nunans-computer.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386" bash: "/bin/bash => GNU bash,version 3.2.48(1)-release (x86_64-apple-darwin10.0)" zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" rvm: version: "rvm 1.6.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]" homes: gem: "not set" ruby: "not set" binaries: ruby: "/usr/local/bin/ruby" irb: "/usr/local/bin/irb" gem: "/usr/local/bin/gem" rake: "/usr/local/bin/rake" environment: PATH: "/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/X11/bin:/Users/mary/.rvm/bin:/Users/mary/.rvm/bin" GEM_HOME: "" GEM_PATH: "" MY_RUBY_HOME: "" IRBRC: "" RUBYOPT: "" gemset: ""
任何建议,将不胜感激.
解决方法
编译并安装您自己的readline:
curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz tar xzvf readline-6.1.tar.gz cd readline-6.1 ./configure --prefix=/usr/local make sudo make install cd ..
删除ruby:rvm remove 1.9.2
重新安装:rvm install 1.9.2
(如果本地路径不在您的目录中,则可能需要添加源:rvm install 1.9.1 -C –with-readline-dir = /usr/local /
应该这样做
————-编辑————–
如下面的评论所述,如果你使用homebrew,那么你应该要安装readline.如果您使用的是Mac,则应该使用自制软件.
————如何在10.7上完成阅读———
“readline-6.2没有更新为Mac OS X 10.7(darwin11),所以打开支持/ shobj-conf,并将darwin10更改为darwin11在它出现的两个地方.
资料来源:lamboy