RVM/rbenv 用 rvm 安装 ruby 装不上。。

tank_lei · 2013年11月01日 · 最后由 josh_sulin 回复于 2014年12月18日 · 16964 次阅读

如题,今天想升级到 2.0.0p247?结果失败,还把以前的 ruby 也卸载了,都装不上了。。。 按照 http://ruby-china.org/wiki/install-rails-on-ubuntu-12-04-server 的指示都操作了 只要一到 rvm install ruby 就会出现错误: Error running 'requirements_debian_update_system ', please read /home/teacher/.rvm/log/1383292840/update_system.log Requirements installation failed with status: 100.

查看 log 如下:

[2013-11-01 16:00:40] requirements_debian_update_system
requirements_debian_update_system () 
{ 
    __rvm_try_sudo apt-get --quiet --yes update || { 
        typeset __ret=$?;
        case ${__ret} in 
            100)
                rvm_error "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
"
            ;;
        esac;
        return ${__ret}
    }
}
current path: /etc/apt
command(2): requirements_debian_update_system 
获取:1 http://dl.google.com stable Release.gpg [198 B]
命中 http://dl.google.com stable Release
命中 http://dl.google.com stable/main amd64 Packages
命中 http://dl.google.com stable/main i386 Packages
忽略 http://ppa.launchpad.net precise Release.gpg
忽略 http://dl.google.com stable/main TranslationIndex
忽略 http://ppa.launchpad.net precise Release.gpg
忽略 http://ppa.launchpad.net precise Release
忽略 http://ppa.launchpad.net precise Release
忽略 http://ppa.launchpad.net precise/main i386 Packages/DiffIndex
忽略 http://ppa.launchpad.net precise/main TranslationIndex
忽略 http://dl.google.com stable/main Translation-zh_CN
忽略 http://dl.google.com stable/main Translation-zh
忽略 http://dl.google.com stable/main Translation-en_US
忽略 http://dl.google.com stable/main Translation-en
忽略 http://ppa.launchpad.net precise/main amd64 Packages/DiffIndex
忽略 http://ppa.launchpad.net precise/main i386 Packages/DiffIndex
忽略 http://ppa.launchpad.net precise/main TranslationIndex
获取:2 http://mirrors.163.com precise Release.gpg [198 B]
错误 http://ppa.launchpad.net precise/main Sources
  404  Not Found
错误 http://ppa.launchpad.net precise/main amd64 Packages
  404  Not Found
命中 http://mirrors.163.com precise-security Release.gpg
错误 http://ppa.launchpad.net precise/main Sources
  404  Not Found
命中 http://mirrors.163.com precise-updates Release.gpg
错误 http://ppa.launchpad.net precise/main i386 Packages
  404  Not Found
忽略 http://ppa.launchpad.net precise/main Translation-zh_CN
忽略 http://ppa.launchpad.net precise/main Translation-zh
忽略 http://ppa.launchpad.net precise/main Translation-en_US
命中 http://mirrors.163.com precise-proposed Release.gpg
忽略 http://ppa.launchpad.net precise/main Translation-en
错误 http://ppa.launchpad.net precise/main amd64 Packages
  404  Not Found
错误 http://ppa.launchpad.net precise/main i386 Packages
  404  Not Found
命中 http://mirrors.163.com precise-backports Release.gpg
忽略 http://ppa.launchpad.net precise/main Translation-zh_CN
忽略 http://ppa.launchpad.net precise/main Translation-zh
忽略 http://ppa.launchpad.net precise/main Translation-en_US
忽略 http://ppa.launchpad.net precise/main Translation-en
命中 http://mirrors.163.com precise Release
命中 http://mirrors.163.com precise-security Release
命中 http://mirrors.163.com precise-updates Release
命中 http://mirrors.163.com precise-proposed Release
命中 http://mirrors.163.com precise-backports Release
命中 http://mirrors.163.com precise/main Sources
命中 http://mirrors.163.com precise/restricted Sources
命中 http://mirrors.163.com precise/universe Sources
命中 http://mirrors.163.com precise/multiverse Sources
命中 http://mirrors.163.com precise/main amd64 Packages
命中 http://mirrors.163.com precise/restricted amd64 Packages
命中 http://mirrors.163.com precise/universe amd64 Packages
命中 http://mirrors.163.com precise/multiverse amd64 Packages
命中 http://mirrors.163.com precise/main i386 Packages
命中 http://mirrors.163.com precise/restricted i386 Packages
命中 http://mirrors.163.com precise/universe i386 Packages
命中 http://mirrors.163.com precise/multiverse i386 Packages
命中 http://mirrors.163.com precise/main TranslationIndex
命中 http://mirrors.163.com precise/multiverse TranslationIndex
命中 http://mirrors.163.com precise/restricted TranslationIndex
命中 http://mirrors.163.com precise/universe TranslationIndex
命中 http://mirrors.163.com precise-security/main Sources
命中 http://mirrors.163.com precise-security/restricted Sources
命中 http://mirrors.163.com precise-security/universe Sources
命中 http://mirrors.163.com precise-security/multiverse Sources
命中 http://mirrors.163.com precise-security/main amd64 Packages
命中 http://mirrors.163.com precise-security/restricted amd64 Packages
命中 http://mirrors.163.com precise-security/universe amd64 Packages
命中 http://mirrors.163.com precise-security/multiverse amd64 Packages
命中 http://mirrors.163.com precise-security/main i386 Packages
命中 http://mirrors.163.com precise-security/restricted i386 Packages
命中 http://mirrors.163.com precise-security/universe i386 Packages
命中 http://mirrors.163.com precise-security/multiverse i386 Packages
命中 http://mirrors.163.com precise-security/main TranslationIndex
命中 http://mirrors.163.com precise-security/multiverse TranslationIndex
命中 http://mirrors.163.com precise-security/restricted TranslationIndex
命中 http://mirrors.163.com precise-security/universe TranslationIndex
命中 http://mirrors.163.com precise-updates/main Sources
命中 http://mirrors.163.com precise-updates/restricted Sources
命中 http://mirrors.163.com precise-updates/universe Sources
命中 http://mirrors.163.com precise-updates/multiverse Sources
命中 http://mirrors.163.com precise-updates/main amd64 Packages
命中 http://mirrors.163.com precise-updates/restricted amd64 Packages
命中 http://mirrors.163.com precise-updates/universe amd64 Packages
命中 http://mirrors.163.com precise-updates/multiverse amd64 Packages
命中 http://mirrors.163.com precise-updates/main i386 Packages
命中 http://mirrors.163.com precise-updates/restricted i386 Packages
命中 http://mirrors.163.com precise-updates/universe i386 Packages
命中 http://mirrors.163.com precise-updates/multiverse i386 Packages
命中 http://mirrors.163.com precise-updates/main TranslationIndex
命中 http://mirrors.163.com precise-updates/multiverse TranslationIndex
命中 http://mirrors.163.com precise-updates/restricted TranslationIndex
命中 http://mirrors.163.com precise-updates/universe TranslationIndex
命中 http://mirrors.163.com precise-proposed/main Sources
命中 http://mirrors.163.com precise-proposed/restricted Sources
命中 http://mirrors.163.com precise-proposed/universe Sources
命中 http://mirrors.163.com precise-proposed/multiverse Sources
命中 http://mirrors.163.com precise-proposed/main amd64 Packages
命中 http://mirrors.163.com precise-proposed/restricted amd64 Packages
命中 http://mirrors.163.com precise-proposed/universe amd64 Packages
命中 http://mirrors.163.com precise-proposed/multiverse amd64 Packages
命中 http://mirrors.163.com precise-proposed/main i386 Packages
命中 http://mirrors.163.com precise-proposed/restricted i386 Packages
命中 http://mirrors.163.com precise-proposed/universe i386 Packages
命中 http://mirrors.163.com precise-proposed/multiverse i386 Packages
命中 http://mirrors.163.com precise-proposed/main TranslationIndex
命中 http://mirrors.163.com precise-proposed/multiverse TranslationIndex
命中 http://mirrors.163.com precise-proposed/restricted TranslationIndex
命中 http://mirrors.163.com precise-proposed/universe TranslationIndex
命中 http://mirrors.163.com precise-backports/main Sources
命中 http://mirrors.163.com precise-backports/restricted Sources
命中 http://mirrors.163.com precise-backports/universe Sources
命中 http://mirrors.163.com precise-backports/multiverse Sources
命中 http://mirrors.163.com precise-backports/main amd64 Packages
命中 http://mirrors.163.com precise-backports/restricted amd64 Packages
命中 http://mirrors.163.com precise-backports/universe amd64 Packages
命中 http://mirrors.163.com precise-backports/multiverse amd64 Packages
命中 http://mirrors.163.com precise-backports/main i386 Packages
命中 http://mirrors.163.com precise-backports/restricted i386 Packages
命中 http://mirrors.163.com precise-backports/universe i386 Packages
命中 http://mirrors.163.com precise-backports/multiverse i386 Packages
命中 http://mirrors.163.com precise-backports/main TranslationIndex
命中 http://mirrors.163.com precise-backports/multiverse TranslationIndex
命中 http://mirrors.163.com precise-backports/restricted TranslationIndex
命中 http://mirrors.163.com precise-backports/universe TranslationIndex
命中 http://mirrors.163.com precise/main Translation-zh_CN
命中 http://mirrors.163.com precise/main Translation-en
命中 http://mirrors.163.com precise/multiverse Translation-zh_CN
命中 http://mirrors.163.com precise/multiverse Translation-en
命中 http://mirrors.163.com precise/restricted Translation-zh_CN
命中 http://mirrors.163.com precise/restricted Translation-en
命中 http://mirrors.163.com precise/universe Translation-zh_CN
命中 http://mirrors.163.com precise/universe Translation-en
命中 http://mirrors.163.com precise-security/main Translation-en
命中 http://mirrors.163.com precise-security/multiverse Translation-en
命中 http://mirrors.163.com precise-security/restricted Translation-en
命中 http://mirrors.163.com precise-security/universe Translation-en
命中 http://mirrors.163.com precise-updates/main Translation-zh_CN
命中 http://mirrors.163.com precise-updates/main Translation-en
命中 http://mirrors.163.com precise-updates/multiverse Translation-zh_CN
命中 http://mirrors.163.com precise-updates/multiverse Translation-en
命中 http://mirrors.163.com precise-updates/restricted Translation-zh_CN
命中 http://mirrors.163.com precise-updates/restricted Translation-en
命中 http://mirrors.163.com precise-updates/universe Translation-zh_CN
命中 http://mirrors.163.com precise-updates/universe Translation-en
命中 http://mirrors.163.com precise-proposed/main Translation-zh_CN
命中 http://mirrors.163.com precise-proposed/main Translation-en
命中 http://mirrors.163.com precise-proposed/multiverse Translation-zh_CN
命中 http://mirrors.163.com precise-proposed/multiverse Translation-en
命中 http://mirrors.163.com precise-proposed/restricted Translation-zh_CN
命中 http://mirrors.163.com precise-proposed/restricted Translation-en
命中 http://mirrors.163.com precise-proposed/universe Translation-zh_CN
命中 http://mirrors.163.com precise-proposed/universe Translation-en
命中 http://mirrors.163.com precise-backports/main Translation-en
命中 http://mirrors.163.com precise-backports/multiverse Translation-en
命中 http://mirrors.163.com precise-backports/restricted Translation-en
命中 http://mirrors.163.com precise-backports/universe Translation-en
下载 396 B,耗时 1分 23秒 (4 B/s)
W: 无法下载 http://ppa.launchpad.net/fcitx-team/stable/ubuntu/dists/precise/main/source/Sources  404  Not Found

W: 无法下载 http://ppa.launchpad.net/fcitx-team/stable/ubuntu/dists/precise/main/binary-amd64/Packages  404  Not Found

W: 无法下载 http://ppa.launchpad.net/wengxt/fcitx-nightly/ubuntu/dists/precise/main/source/Sources  404  Not Found

W: 无法下载 http://ppa.launchpad.net/fcitx-team/stable/ubuntu/dists/precise/main/binary-i386/Packages  404  Not Found

W: 无法下载 http://ppa.launchpad.net/wengxt/fcitx-nightly/ubuntu/dists/precise/main/binary-amd64/Packages  404  Not Found

W: 无法下载 http://ppa.launchpad.net/wengxt/fcitx-nightly/ubuntu/dists/precise/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
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

这个怎么解决?着急阿!

我现在执行 gem 命令,都提示如下: /home/teacher/.rvm/bin/gem: 行 6: /home/teacher/.rvm/bin/gem: 参数列表过长 /home/teacher/.rvm/bin/gem: 行 6: /home/teacher/.rvm/bin/gem: 成功

Debian 换官方 APT 源,然后更新一下 source list,然后在尝试一次。

#2 楼 @lgn21st 我的是 ubuntu12.04,默认是下面这个源,也不好使:

deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricteddeb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted

deb http://cn.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise universe
deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates universe

 deb http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
 deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates multiverse
 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates multiverse

deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
 45 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

看 logs 是 fcitx 的 ppa 失效了,apt update 失败,先去掉。

#4 楼 @Rei 源文件里没有这个选项

deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

哪个是的?

#5 楼 @tank_lei 我也不太会管理 ppa,如果知道 ppa 标识的话用 sudo add-apt-repository -r repo-id 来删除,不过一般我都忘了,我会打开系统自带的软件源管理工具来删。

头两天我就遇到这个问题 简单的处理方法是删除 /etc/apt/sources.list.d 下面的内容 然后执行一次 sudo apt-get update然后再次安装 rvm install 2.0.0

主要的问题是手动 itanjia 的几个源不能访问或者失效。

#8 楼 @Shadow 嗯嗯,刚我也这么搞的!弄成功了!一下午的时光就弄这个了。。

也遇到这个问题了。搞不定,最后放弃了,不在本地搞了,直接上 vps 上弄 - -!

我是直接 $ sudo rm /var/lib/apt/lists/lock 然后继续安装

遇到了和楼主一样的问题,终于在这里(http://stackoverflow.com/questions/20789754/rvm-requirements-error-on-ubuntu-13-10)找到了线索,解决步骤如下: $ rvm autolibs read-fail $ rvm install 2.0.0-p353 Searchng for binary rubies, this might take some time. No binary rubies available for: ubuntu/14.04/x86_64/ruby-2.0.0-p353. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for ubuntu. Missing required packages: libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison libffi-dev RVM autolibs is now configured with mode '2' => 'check and stop if missing', please run rvm autolibs enable to let RVM do its job or run and read rvm autolibs [help] or visit https://rvm.io/rvm/autolibs for more information. Requirements installation failed with status: 1.

虽然还是失败,但是已经提示了缺少的包,只要手工安装这些包,再重新运行上面的命令就可以了

$ sudo apt-get install libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison libffi-dev $ rvm install 2.0.0-p353

查了一下官网,在这里(http://rvm.io/rvm/autolibs)有解释: Tell RVM to fail when something is missing (2) rvm autolibs read-fail

#12 楼 @caozhzh 回答的很准确。谢谢。

@caozhzh 回答的很好。有谁能解释一下:rvm autolibs packages、rvm autolibs read-only、rvm autolibs disable、rvm autolibs enable 这 5 个的应用场景吗?

需要 登录 后方可回复, 如果你还没有账号请 注册新账号