jekyll - bundler 无法安装 commonmarker
问题描述
我正在尝试建立一个 GitHub Pages repo。我遵循的步骤:
安装捆绑器
$ gem install bundler
Fetching: bundler-2.0.2.gem (100%)
Successfully installed bundler-2.0.2
Parsing documentation for bundler-2.0.2
Installing ri documentation for bundler-2.0.2
Done installing documentation for bundler after 27 seconds
1 gem installed
好的。
在当前 GH 版本 (3.8.5) 中创建指定 Jekyll 的 Gemfile
source "https://rubygems.org"
gem "jekyll", "3.8.5"
运行捆绑安装
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching public_suffix 4.0.1
Installing public_suffix 4.0.1
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.0.2
Fetching colorator 1.1.0
Installing colorator 1.1.0
Using concurrent-ruby 1.1.5
Fetching eventmachine 1.2.7 (x64-mingw32)
Installing eventmachine 1.2.7 (x64-mingw32)
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.1
Installing em-websocket 0.5.1
Fetching ffi 1.11.2 (x64-mingw32)
Installing ffi 1.11.2 (x64-mingw32)
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Using i18n 0.9.5
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.0
Installing rb-inotify 0.10.0
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching jekyll-sass-converter 1.5.2
Installing jekyll-sass-converter 1.5.2
Fetching listen 3.2.0
Installing listen 3.2.0
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching kramdown 1.17.0
Installing kramdown 1.17.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.3.6
Installing mercenary 0.3.6
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.13.0
Installing rouge 3.13.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching jekyll 3.8.5
Installing jekyll 3.8.5
Bundle complete! 1 Gemfile dependency, 25 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from sass:
Ruby Sass has reached end-of-life and should no longer be used.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
https://sass-lang.com/blog/posts/7828841
关于过时软件包的一些警告,但很好。
创建新站点(指南步骤 7)
$ bundler exec jekyll new .
将 Gemfile 重写为
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
和输出:
Running bundle install in C:/Projects/coding-for-smarties...
Bundler: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:287:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `each'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:255:in `verify_gemfile_dependencies_are_found!'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:49:in `start'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/resolver.rb:22:in `resolve'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:258:in `resolve'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:170:in `specs'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:237:in `specs_for'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:226:in `requested_specs'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:108:in `block in definition_method'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:20:in `setup'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
Bundler: from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/setup.rb:20:in `<top (required)>'
Bundler: from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Bundler: from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
错误在 Gemfile 中列出的任何 gem 源中找不到 gem 'minima (~> 2.0) x64-mingw32'。
可能不是问题,因为无论如何我想要一个不同的主题。所以我更新了它,并且我还做了指南步骤 8 和 9 中建议的更改。
再次尝试安装
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......................
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Fetching minitest 5.13.0
Installing minitest 5.13.0
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching activesupport 4.2.10
Installing activesupport 4.2.10
Fetching public_suffix 2.0.5 (was 4.0.1)
Installing public_suffix 2.0.5 (was 4.0.1)
Using addressable 2.7.0
Using bundler 2.0.2
Fetching coffee-script-source 1.11.1
Installing coffee-script-source 1.11.1
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Using colorator 1.1.0
Fetching ruby-enum 0.7.2
Installing ruby-enum 0.7.2
Fetching commonmarker 0.17.13
Installing commonmarker 0.17.13 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20191114-10956-3hyma7.rb extconf.rb
creating Makefile
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR=" clean
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR="
generating commonmarker-x64-mingw32.def
compiling arena.c
compiling autolink.c
compiling blocks.c
compiling buffer.c
compiling cmark.c
compiling cmark_ctype.c
compiling commonmark.c
compiling commonmarker.c
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:631:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
631 | CONSTFUNC(void rb_secure_update(VALUE));
| ^~~~~~~~~
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:2012,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/ruby/intern.h:257:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
257 | CONSTFUNC(void rb_error_untrusted(VALUE));
| ^~~~~~~~~
C:/Ruby24-x64/include/ruby-2.4.0/ruby/intern.h:259:1: warning: 'const' attribute
on function returning 'void' [-Wattributes]
259 | CONSTFUNC(void rb_check_trusted(VALUE));
| ^~~~~~~~~
In file included from houdini.h:9,
from commonmarker.c:3:
config.h:8: warning: "HAVE_STDBOOL_H" redefined
8 | #define HAVE_STDBOOL_H
|
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:24,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from commonmarker.h:9,
from commonmarker.c:1:
C:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32/ruby/config.h:30: note: this is the
location of the previous definition
30 | #define HAVE_STDBOOL_H 1
|
compiling core-extensions.c
compiling ext_scanners.c
compiling footnotes.c
compiling houdini_href_e.c
compiling houdini_html_e.c
compiling houdini_html_u.c
compiling html.c
compiling inlines.c
compiling iterator.c
compiling latex.c
compiling linked_list.c
compiling man.c
compiling map.c
compiling node.c
compiling plaintext.c
compiling plugin.c
compiling references.c
compiling registry.c
compiling render.c
compiling scanners.c
compiling strikethrough.c
compiling syntax_extension.c
compiling table.c
compiling tagfilter.c
compiling utf8.c
compiling xml.c
linking shared-object commonmarker/commonmarker.so
C:/Ruby24-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
strikethrough.o:strikethrough.c:(.text+0x2ba): undefined reference to
`__memset_chk'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: commonmarker.so] Error 1
make failed, exit code 2
Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.13 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/commonmarker-0.17.13/gem_make.out
An error occurred while installing commonmarker (0.17.13), and Bundler
cannot continue.
Make sure that `gem install commonmarker -v '0.17.13' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
github-pages was resolved to 187, which depends on
jekyll-commonmark-ghpages was resolved to 0.1.5, which depends on
jekyll-commonmark was resolved to 1.3.1, which depends on
commonmarker
错误安装 commonmarker (0.17.13) 时出错,Bundler 无法继续。
我无法克服这一点。我能做的最好的就是删除我所有的 gem 包并重新启动,这只会让我回到这里。
解决方案
另一种方法是“在带有 Docker 的 Windows 中使用 Jekyll ”(来自James Sturtevant)
这将利用 Docker 映像jekyll/jekyll
(请参阅其自述文件)。
export JEKYLL_VERSION=3.8
docker run --rm \
--volume="$PWD:/srv/jekyll" \
-it jekyll/jekyll:$JEKYLL_VERSION \
jekyll build
而且您不必安装 ruby 或与缺少的依赖项搏斗。
推荐阅读
- javascript - 为什么 5<4<2 返回真?
- angular - Angular 2+ 社交分享链接预览
- karma-jasmine - 无法加载记者“coverage-istanbul”
- python - 如何跨 SQL Server 和 Postgres 比较表中的数据?
- android - 使用 Google Play 应用签名 - 如何进行更新版本测试
- c++ - 除非我在我的项目中手动复制它,否则无法打开 lib
- google-cloud-platform - libcloud 和 GCP。如何使用服务帐户进行身份验证
- html - 将联系人页面链接到 HTML5 中的主页
- javascript - jQuery 表单验证不适用于引导模式
- json - 尝试从 s3 读取 json 时不断收到错误消息