欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

报错解决:ERROR: While executing gem ... (Gem::CommandLineError)

程序员文章站 2022-07-14 17:05:12
...

在使用GitHub Pages博客-- Jekyll搭建了自己的博客:https://zhang0peter.com/后,GitHub发了一个警告给我:

We found a vulnerable dependency in a repository you have security alert access to.

@zhang0peter	zhang0peter/zhang0peter.github.io
Known moderate severity security vulnerability detected in activesupport < 4.1.11 defined in Gemfile.lock.
You have automated security updates enabled, so we are attempting to create a pull request to update the vulnerable dependency.
Upgrade activesupport to version 4.1.11 or later. For example:
gem "activesupport", ">= 4.1.11"
moderate severity
Vulnerable versions: < 4.1.11
Patched version: 4.1.11
The (1) jdom.rb and (2) rexml.rb components in Active Support in Ruby on Rails before 4.1.11 and 4.2.x before 4.2.2, when JDOM or REXML is enabled, allow remote attackers to cause a denial of service (SystemStackError) via a large XML document depth.

我也不会ruby,不知道怎么操作,感觉应该更新一下就可以了:

bundle install
bundle update

但是没用。
然后我尝试:

C:\Users\peter\Documents\GitHub\zhang0peter.github.io>gem 'activesupport', '~> 4.1', '>= 4.1.11'
ERROR:  While executing gem ... (Gem::CommandLineError)
    Unknown command activesupport,

报错了,查找后发现是这句话要加在Gemfile的最后一行,而不是命令行运行这个命令。
然后再跑命令:

bundle update

问题解决。