我正在开发一个网络抓取脚本,但是当前的gem版本没有给我任何要安装的软件包。
我知道这是因为某些基础架构更改原因,但现在我已经安装了Windows 10的周年纪念更新并安装了一个Linux子系统。
我已经安装了NodeJS + npm,它们正常工作,但问题是在该子系统上安装Ruby。
当我尝试安装RVM时,它给了我一个错误:
ins@DESKTOP-TK9ELEL:~$ sudo apt-get install rvm
sudo: unable to resolve host DESKTOP-TK9ELEL
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
rvm : Depends: libreadline6-dev but it is not installable
Depends: autoconf but it is not installable
Depends: libgdbm-dev but it is not installable
Depends: libncurses5-dev but it is not installable
Depends: automake but it is not installable
Depends: libtool but it is not installable
Depends: bison but it is not installable
Depends: pkg-config but it is not installable
E: Unable to correct problems, you have held broken packages.
我该如何解决这个问题?
答案 0 :(得分:1)
关注其网站上的install directions for RVM。没有人比作者更了解RVM。
\curl -sSL https://get.rvm.io | bash -s stable --ruby
这将安装稳定版本的RVM和Ruby。
使用后:
rvm use [whichever Ruby was installed] --default
告诉RVM默认为Ruby。
如果您使用他们的指示,RVM能够安装* nix发行版的先决条件。安装RVM后,您无需使用sudo
或yum
为RVM管理的Ruby安装任何内容。这意味着不使用sudo rvm install ruby...
或sudo gem install some_gem
。如果你这样做,你只会强迫你的系统做错事。