3

使用 RVM 安装 Ruby1.9.3 时 rvm install 1.9.3,它显示以下消息。

The program 'rvm' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-rvm

之后我尝试安装 ruby​​-rvm 但它最后显示以下消息。

...
Setting up libreadline-gplv2-dev (5.2-11) ...
Setting up ruby-rvm (1.6.9-0ubuntu2) ...
dpkg-statoverride: error: syntax error: unknown group 'admin' in statoverride file
dpkg: error processing ruby-rvm (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 ruby-rvm
E: Sub-process /usr/bin/dpkg returned an error code (1)

收到此消息后,我在此处查看,但无法弄清楚上述错误代码的含义。

virus@virus-pc:~$ source /usr/local/rvm/scripts/rvm

virus@virus-pc:~$ type rvm | head -1
rvm is a function

virus@virus-pc:~$ rvm use 1.9.3 --default
ruby-1.9.3-p194 is not installed.
To install do: 'rvm install ruby-1.9.3-p194'

virus@virus-pc:~$ rvm install ruby-1.9.3-p194
ruby-1.9.3-p194 - #configure
ruby-1.9.3-p194 - #download
Archive checksum did not match, downloading again.
rm: cannot remove `bin-ruby-1.9.3-p194.tar.bz2': Permission denied
curl: Can't open 'bin-ruby-1.9.3-p194.tar.bz2'!
curl: try 'curl --help' or 'curl --manual' for more information
There was an error(23), please check /usr/local/rvm/log//*.log. Next we'll try to fetch via http.
Trying ftp:// URL instead.
curl: Can't open 'bin-ruby-1.9.3-p194.tar.bz2'!
curl: try 'curl --help' or 'curl --manual' for more information
There was an error(23), please check /usr/local/rvm/log//*.log
Downloading https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p194.tar.bz2 failed.
Mounting remote ruby failed, trying to compile.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
mkdir: cannot create directory `/usr/local/rvm/log/ruby-1.9.3-p194': Permission denied
tee: /usr/local/rvm/log/ruby-1.9.3-p194/fetch.log: No such file or directory
bash: /usr/local/rvm/log/ruby-1.9.3-p194/fetch.log: No such file or directory
Error running '/usr/local/rvm/scripts/fetch http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.bz2', please read /usr/local/rvm/log/ruby-1.9.3-p194/fetch.log
There has been an error fetching the ruby interpreter. Halting the installation.
bash: /usr/local/rvm/user/installs.new: Permission denied
mv: cannot stat `/usr/local/rvm/user/installs.new': No such file or directory
bash: /usr/local/rvm/user/installs: Permission denied

我曾尝试安装它并浪费了 3 天,但无法成功在 Rails 上安装 ruby​​ 并解决上述错误。由于我是 ruby​​ 新手,因此感谢任何帮助。

环境:Ubuntu-12.04 64位

4

2 回答 2

2

您正在尝试使用apt-get. 您可能安装了 ruby​​-rvm,但由于它已过时,因此安装已损坏。您可能必须使用突触或通过sudo apt-get purge ruby-rvm命令删除它。您不应该通过apt-get. 更仔细地阅读 Ryan 的帖子。安装 rvm 的正确命令是:

curl -L https://get.rvm.io | bash -s 稳定

于 2012-10-06T21:08:53.717 回答
1

\curl -L https://get.rvm.io | bash -s 稳定 --ruby

在 curl 之前注意反斜杠

于 2014-01-22T15:33:36.870 回答