Ruby RVM apt-get update error

2019-01-13 02:03发布

I get following error when trying to install anything with RVM:

Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/ubuntu/13.04/x86_64/ruby-2.1.1.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..kshitiz password required for 'apt-get --quiet --yes update': 
............................
Error running 'requirements_debian_update_system ruby-2.1.1',
showing last 15 lines of /home/kshitiz/.rvm/log/1400047196_ruby-2.1.1/update_system.log
++ /scripts/functions/logging : rvm_pretty_print()  78 > case "${TERM:-dumb}" in
++ /scripts/functions/logging : rvm_pretty_print()  81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print()  83 > [[ -t 2 ]]
++ /scripts/functions/logging : rvm_pretty_print()  83 > return 1
++ /scripts/functions/logging : rvm_error()  117 > 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

++ /scripts/functions/requirements/ubuntu : requirements_debian_update_system()  53 > return 100
Requirements installation failed with status: 100.

How can I fix this?

标签: ruby rvm
15条回答
▲ chillily
2楼-- · 2019-01-13 02:37

You can try to skip the rvm updating system so apt-get won't be called.

# Disable RVM from trying to install necessary software via apt-get
rvm autolibs disable

# Then try installing Ruby:
rvm install 2.4.0

See https://stackoverflow.com/a/16759839/1212791

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-13 02:37

You don't need of apt-get to install rvm and to use it !

Just curl (apt-get install curl)

Launch \curl -sSL https://get.rvm.io | bash -s stable --ruby

and rvm install 2.1.1 or another ruby's version and it works ;)

gem update etc...

RVM will be independent of apt-get so you'll have no longer issu.

For more informations : https://rvm.io/rvm/install

查看更多
迷人小祖宗
4楼-- · 2019-01-13 02:37

In my case rvm missed some linux packages, which couldnt be installed without sudo. There were no apt-get install errors at all.

When running rvm install ruby x.x.x with sudo, rvm installed packages required to build ruby and it worked.

查看更多
Ridiculous、
5楼-- · 2019-01-13 02:39

This happened to me as well when I was trying to install a version of Ruby as a non-sudoer user. However, when I logged in as my admin user (with sudo privileges) and ran sudo apt-get update | grep "Failed" I would get no errors and, yet, rvm install x.x.x would still result in asking for a password (when I ran rvm install as the non-sudoer user.)

I was banging my head with this for a while because I didn't want my rvm (regular user) user to have sudo privileges. Then after some putzing around on Google I figured out that I could log in as my admin user.

Go through the steps of installing RVM for that user (as per their documentation):

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

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

$ source ~/.rvm/scripts/rvm

Then (as the admin user) jump straight into installing the RVM required packages:

$ rvm requirements

at which point it asks for my sudo password and installs the required apt packages for the entire system after I enter my password.

Then I log off from server as admin user and log back in as rvm user (with no sudo privileges) and try to install a version of Ruby.

$ rvm install x.x.x

and now it works.

查看更多
Summer. ? 凉城
6楼-- · 2019-01-13 02:44

I was also getting this error when my working directory was inside a mounted dir.

The fix was just to:

cd ~

I figured this out by seeing this at the bottom of a sudo apt-get update

E: Unable to change to /path/to/my/current/directory/ - chdir (13: Permission denied)

查看更多
Rolldiameter
7楼-- · 2019-01-13 02:44

I got the same error.I tried most of above answers but none works for me, so i just change server

  1. Goto directory etc/apt
  2. click on Sources.list
  3. Change the server to us or some else server
  4. Reload (it will update your cache from that server)
  5. Then run sudo apt-get update
查看更多
登录 后发表回答