Jekyll的gemfile以及package-lock.json的修改

jekyll依赖

Posted by MetaNetworks on January 21, 2020
本页面总访问量

这两天刚好要升级一些博客的插件来解决一些安全问题,顺便记录一下

修改Gemfile

  • 添加依赖
    • source + 'URL'表示数据来源
    • gem 'module_name','version',group:模块

source ‘https://rubygems.org’

gem ‘jekyll-admin’, group: :jekyll_plugins gem ‘jekyll-paginate’ gem “rack”, “>= 1.6.12”

修改package-lock.json

可访问https://registry.npmjs.org/xxx获取所有版本信息,xxx为模块名

以下是例子

“lodash”: { “version”: “4.17.12”, “resolved”: “https://registry.npmjs.org/lodash/-/lodash-4.17.12.tgz”, “integrity”: “sha512-+CiwtLnsJhX03p20mwXuvhoebatoh5B3tt+VvYlrPgZC1g36y+RRbkufX95Xa+X4I59aWEacDFYwnJZiyBh9gA==” },

编译运行

  • jekyll serve
    • gem提示版本被锁,可执行gem更新操作
      • bundle update xxx(模块名)
    • 若提示You have already activated public_suffix 4.0.3, but your Gemfile requires public_suffix 3.0.3. Prepending bundle exec to your command may solve this. (Gem::LoadError)等类似的错误,可以尝试在指令前加bundle exec
      • bundle exec jekyll serve