2012-04-27 104 views
1

尝试使用RVM安装1.9.3。无法在干净的Lion安装上安装Ruby 1.9.3

收到这些错误在我make.log

compiling readline.c 
readline.c:1499:9: error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'? 
            rl_username_completion_function); 
            ^
readline.c:69:42: note: expanded from macro 'rl_username_completion_function' 
# define rl_username_completion_function username_completion_function 
             ^
/usr/local/include/readline/readline.h:443:14: note: 'rl_username_completion_function' declared here 
extern char *rl_username_completion_function PARAMS((const char *, int)); 
      ^
1 error generated. 
make[2]: *** [readline.o] Error 1 
make[1]: *** [ext/readline/all] Error 2 
make: *** [build-ext] Error 2 

我在SL之前遇到过这个问题。我安装了Xcode 4.3.2(也安装了命令行工具)我已安装readline 6.2.2。

export ARCHFLAGS="-arch x86_64"添加到我的.bash_login文件中。

我也试过rvm install 1.9.3 --with-gcc=clang但我得到了同样的错误,我宁愿避免这样做,因为有限的支持。

任何人都有一个可行的程序?

编辑:

Link to related open Ruby ticket

+0

什么“有限支持”你在说什么RVM?截至[1.9.3-p125](http://www.ruby-lang.org/en/news/2012/02/16/ruby-1-9-3-p125-is-released/)clang正式发布支持的。 – 2012-04-27 01:28:08

+0

哦,在那种情况下,它很好,但是当我尝试使用clang进行安装时,仍然出现相同的错误 – 2012-04-27 01:38:37

+0

您是否已经手动安装了readline?毕竟,它确实带有OS X。 – 2012-04-27 01:40:46

回答

1

我解决了这个问题。 RVM无法识别安装的readline。有趣的是,readline设法搞砸了这么多人的安装。

此命令点向右readline的位置

rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr 
+0

Ruby是为GNU readline而设计的。 BSD一个也不行。 – Reactormonk 2012-04-27 08:38:12

+0

这对我不起作用。 – nnyby 2012-08-20 06:43:26

+0

@nnyby你在Lion或ML上试试这个吗? – 2012-08-21 22:16:54