在使用 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位