簡體   English   中英

使用rvm安裝最新的RUBY會在Ubuntu上出錯

[英]Installing latest RUBY with rvm gives error on Ubuntu

我試圖安裝ruby-2.1.2時出現以下錯誤

rvm install ruby-2.1.2
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.2.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system................
Error running 'requirements_debian_update_system ruby-2.1.2',
showing last 15 lines of /usr/local/rvm/log/1400060285_ruby-2.1.2/update_system.log
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'There has been error while updating '\''apt-get'\'', please give it some time and try again later.
For 404 errors check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
\n'
There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list
++ return 100
sudo apt-get install gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

我認為你的rvm是舊版本,

使用以下命令安裝最新的(v1.25.25)rvm:

$ \\curl -L https://get.rvm.io | bash -s stable --ruby

然后檢查此版本可用的紅寶石:

$ rvm list known

然后安裝最新的:

$ rvm install ruby-2.1.2

注意:即使它沒有顯示在rvm list known它也會嘗試使用以下消息進行下載:

Installing Ruby from source to: /home/<YOUR_USER_NAME>/.rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)...

在我的情況下這個錯誤是因為apt-get update出錯了。 在做了手動sudo apt-get update之后,我注意到其中一個repos發出錯誤“W:無法獲取”。 編輯了repo列表並刪除了導致錯誤的列表后我就能安裝了。

嘗試使用它來安裝最新的ruby

rvm mount -r https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p194.tar.bz2

尋求更多幫助

rvm help mount

我嘗試了上面的大部分答案,但沒有一個適合我,所以我只是更改服務器如果你使用rvm為ruby然后這將工作。

  1. 轉到目錄etc / apt
  2. 點擊Sources.list
  3. 將服務器更改為我們或其他服務器
  4. 重新加載(它將從該服務器更新您的緩存)
  5. 然后運行sudo apt-get update
  6. 最后運行rvm install 2.3.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM