Ruby安装出错:无法安装jekyl

mum43rcc  于 2023-02-18  发布在  Ruby
关注(0)|答案(1)|浏览(417)

我试图使用依赖Ruby的Jekyll(就像这里)设置一个GitHub页面。不幸的是,我想我有点搞砸了安装(在几个sudo apt-get install ruby-fullsudo apt-get remove ruby-full之后...)
现在,我的电脑上有一个老版本的Ruby(我想是),我无法更新,下面是我的系统现在的状态:

$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ gem -v
3.1.2
$ gem install jekyll
ERROR:  Error installing jekyll:
    The last version of sass-embedded (~> 1.54) to support your Ruby & RubyGems was 1.58.0. Try installing it with `gem install sass-embedded -v 1.58.0` and then running the current command again
    sass-embedded requires RubyGems version >= 3.3.22. The current RubyGems version is 3.1.2. Try 'gem update --system' to update RubyGems itself.
$ gem update --system
Updating rubygems-update
Successfully installed rubygems-update-3.4.6
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.6
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.4.6
Traceback (most recent call last):
    5: from setup.rb:22:in `<main>'
    4: from setup.rb:22:in `require'
    3: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `<top (required)>'
    2: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1332:in `require'
    1: from /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:49:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:50:in `<class:Specification>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
    3: from setup.rb:22:in `<main>'
    2: from setup.rb:22:in `require'
    1: from /home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1328:in `<top (required)>'
/home/jarret/gems/gems/rubygems-update-3.4.6/lib/rubygems.rb:1342:in `rescue in <top (required)>': undefined method `rubyforge_project=' for class `Gem::Specification' (NameError)
Loading the /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb file caused an error. This file is owned by your OS, not by rubygems upstream. Please find out which OS package this file belongs to and follow the guidelines from your OS to report the problem and ask for help.
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.2
  - RUBY VERSION: 2.7.0 (2019-12-25 patchlevel 0) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /home/jarret/gems
  - USER INSTALLATION DIRECTORY: /home/jarret/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.7
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/jarret/gems/bin
  - SPEC CACHE DIRECTORY: /home/jarret/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/jarret/gems
     - /home/jarret/.gem/ruby/2.7.0
     - /var/lib/gems/2.7.0
     - /usr/lib/ruby/gems/2.7.0
     - /usr/share/rubygems-integration/2.7.0
     - /usr/share/rubygems-integration/all
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/jarret/gems/bin
     - /home/jarret/miniconda3/condabin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin
     - /opt/fiji/Fiji.app

我试过很多删除/安装,我试过更新宝石,Ruby。没有解锁我至今。

sr4lhrrt

sr4lhrrt1#

尝试替换ruby3.0,sass1.58太高级,可能与ruby2.7不兼容。请按照以下步骤操作并运行该命令。

  1. rvm install 3.0
  2. rvm use 3.0.0 -default
  3. rvm -v
  4. rvm gemset update
  5. gem install jekyll
  6. jekyll -v

相关问题