2011-12-29 137 views
12

我在我的ubyntu 11.10上使用rvm。我的readline不工作,我試過ruby extconf.rb但它沒有通過。輸出爲波紋管:Readline不能在rvm工作 - Ubuntu 11.10

$ ruby extconf.rb 
checking for tgetnum() in -lncurses... yes 
checking for readline/readline.h... yes 
checking for readline/history.h... yes 
checking for readline() in -lreadline... no 
checking for readline() in -ledit... no 
checking for editline/readline.h... no 

我嘗試安裝好libncurses5-dev的&中的libreadline5-dev的

$ sudo apt-get install libncurses5-dev libreadline5-dev 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Package libreadline5-dev is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or 
is only available from another source 
However the following packages replace it: 
    libreadline-gplv2-dev:i386 lib64readline-gplv2-dev:i386 libreadline-gplv2-dev 

E: Package 'libreadline5-dev' has no installation candidate 

這裏有什麼問題?誰能幫忙?

回答

7

我得到了解決:

運行命令

rvm requirements 

它顯示了這些要求和依賴性。安裝並重新安裝紅寶石上rvm

rvm remove 1.9.2 
rvm install 1.9.2 

它的工作原理!

+0

這對我有效,但是隻有在徹底刪除/ usr/local/rvm並從頭重新安裝rvm。看起來'rvm remove 1.9.2'不足以清除任何被緩存的內容。 – 2012-03-03 07:52:21

2

你試過:

rvm pkg install readline 

然後通過RVM --with-readline-dir=$rvm_path/usr安裝Ruby?

http://beginrescueend.com/packages/readline/

FWIW,我建議給rbenv + ruby-build一去,如果你從來沒有考慮它。比使用RVM少了許多麻煩。

+0

我試過了,但不起作用! – Sayuj 2011-12-29 09:56:08

+0

當你說「不行」時,你的意思是你得到錯誤還是其他的東西?你會得到什麼錯誤(如果你得到它們)? – d11wtq 2011-12-29 10:06:19

+0

我做了'rvm remove 1.9.2','rvm pkg install readline'和'rvm install 1.9.2 --with-readline-dir = $ rvm_path/usr'。沒有錯誤。但是,當我嘗試'irb'時,它顯示,'Readline不能被要求,如果你需要完成或歷史安裝readline然後重新安裝紅寶石。 您可以按照'rvm notes'的依賴關係和/或閱讀文檔頁面https://rvm.beginrescueend.com/packages/readline/。確保你'rvm刪除X; rvm install X'在獲得readline庫之後用readline支持重新編譯你的ruby。 ruby​​-1.9.2-p290:001>' – Sayuj 2011-12-29 10:22:44

21

同樣的問題在這裏Readline errors prevent me running rails console

Ubuntu下,你可以使用該系統的readline安裝。

rvm uninstall ${YOURUBYVERSION} 
sudo apt-get install libreadline-dev 
rvm install ${YOURUBYVERSION} --with-readline-dir=/usr/include/readline 

用你想要的ruby版本替換$ {YOURUBYVERSION}。

+0

libreadline-dev已經是最新版本 – Sayuj 2012-01-04 09:12:01

+1

嗨,跳轉點是 '--with-readline-dir =/usr/include/readline' – zzeroo 2012-01-06 11:34:13

5

出於某種原因,我不能發表評論,@ zzeroo的答案,但我想,他是使用

--with-readline-dir=/usr/include/readline 

,而不是

--with-readline-dir=$rvm_path/usr 

我敲我的頭提請注意這樣一個事實,很長一段時間撞在牆上,改變這一點對我來說是固定的。

2

我GOOGLE了幾天,但沒有答案幫助我,所以我的解決辦法是:

完全刪除RVM How to remove rvm

刪除所有紅寶石包。首先,找出哪些包你有:

dpkg -l | grep ruby 

然後進行

sudo apt-get purge {PACKAGE}

其中{PACKAGE}是要刪除(我有ruby ruby1.8 ruby1.9.1

然後我做了包全新安裝RVM Install RVM並安裝紅寶石1.9.2與

rvm install 1.9.2 

現在它應該工作!

1

我試過了一切,但沒有奏效。我必須做rvm implode(安裝所有需求之後),然後rvm install 1.8.7; rvm安裝1.9.3和它wor