由于 Logstash 的依赖性错误,我正在尝试通过 RVM 在 Raspberry Pi 上重新安装 Ruby 1.9.3 并出现以下错误。其他人有类似的问题:
ruby-1.9.3-p551 - #downloading ruby-1.9.3-p551, this may take a while depending on your connection...
ruby-1.9.3-p551 - #extracting ruby-1.9.3-p551 to /home/pi/.rvm/src/ruby-1.9.3-p551.....
ruby-1.9.3-p551 - #applying patch /home/pi/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p551 - #applying patch /home/pi/.rvm/patches/ruby/1.9.3/CVE-2015-1855-p484.patch.
ruby-1.9.3-p551 - #applying patch /home/pi/.rvm/patches/ruby/1.9.3/update-autoconf.patch.
ruby-1.9.3-p551 - #applying patch /home/pi/.rvm/patches/ruby/1.9.3/openssl3.patch.
ruby-1.9.3-p551 - #configuring..............................................
ruby-1.9.3-p551 - #post-configuration..
ruby-1.9.3-p551 - #compiling..........................................................................................................................................................................
ruby-1.9.3-p551 - #installing........................
ruby-1.9.3-p551 - #making binaries executable..
ruby-1.9.3-p551 - #downloading rubygems-3.0.3
ruby-1.9.3-p551 - #extracting rubygems-3.0.3......
ruby-1.9.3-p551 - #removing old rubygems........
ruby-1.9.3-p551 - #installing rubygems-3.0.3..
Error running 'env GEM_HOME=/home/pi/.rvm/gems/ruby-1.9.3-p551@global GEM_PATH= /home/pi/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -d /home/pi/.rvm/src/rubygems-3.0.3/setup.rb --no-document',
please read /home/pi/.rvm/log/1555769993_ruby-1.9.3-p551/rubygems.install.log
日志文件错误:
command(7): env GEM_HOME=/home/pi/.rvm/gems/ruby-1.9.3-p551@global GEM_PATH= /home/pi/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -d /home/pi/.rvm/src/rubygems-3.0.3/setup.rb --no-document
Exception `LoadError' at /home/pi/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems.rb:1264 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /home/pi/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/rubygems.rb:1273 - cannot load such file -- rubygems/defaults/ruby
/home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require': /home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems/core_ext/kernel_warn.rb:15: syntax error, unexpected tLABEL (SyntaxError)
module_function define_method(:warn) {|*messages, uplevel: nil|
^
/home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems/core_ext/kernel_warn.rb:18: void value expression
/home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems/core_ext/kernel_warn.rb:43: syntax error, unexpected '}', expecting keyword_end
from /home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/pi/.rvm/src/rubygems-3.0.3/lib/rubygems.rb:1395:in `<top (required)>'
from setup.rb:28:in `require'
from setup.rb:28:in `<main>'
有什么建议吗?我不太熟悉 Ruby 或 RVM,因此非常感谢您的帮助。
最佳答案
Ruby 1.9.3-p551于 2014 年 11 月发布,此时可能与最新的 rubygems 不兼容。
尝试安装旧版本的 rubygems ,我会从 2.4.4
开始,因为它与 Ruby 1.9.3 的发布非常吻合,但我也会尝试升级到任何 2.X
因为人们应该期待支持持续几年。
项目的changelog确实提到删除了 1.9.2 的兼容性代码。
关于ruby - 无法安装 Ruby Gems 3.0.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55782909/