我在 Ubuntu 17.10 中安装了 RVM,但是当我尝试安装 Ruby 时出现此错误:
$ rvm install 2.5.0
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/17.10/x86_64/ruby-2.5.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating systemjacques password required for 'apt-get --quiet --yes update': .-|
...
Installing required packages: libreadline6-dev....
Error running 'requirements_debian_libs_install libreadline6-dev',
please read /home/jacques/.rvm/log/1514981551_ruby-2.5.0/package_install_libreadline6-dev.log
Requirements installation failed with status: 100.
如果我尝试安装 libreadline6-dev,apt-get
我会收到此错误:
The following packages have mismatched dependencies:
libreadline6-dev: Depends: libreadline6 (= 6.2-9ubuntu1) but 6.3-8ubuntu8 is to be installed
答案1
以下是我在 Ubuntu 17.10 中解决该问题的方法:
首先,逐个安装所需的依赖项,可以通过执行以下命令完成:
sudo apt install libreadline6
sudo apt install libreadline6-dev
sudo apt install libgmp-dev
sudo apt install software-properties-common
然后按照正常安装说明进行操作:
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt update
sudo apt install rvm
source /etc/profile.d/rvm.sh
rvm install 2.5.0
如果您愿意,我可以一步一步分享我所遵循的过程的屏幕截图。
希望能帮助到你。