2012-04-27 120 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

相關問題