GitHub PagesのJekyllでError: jekyll-remote-theme が発生した
GitHub PagesのJekyllで公開しているサイトがあるのですがbundle update
したら若干はまったのでメモ。
Summary
- GitHub PagesのJekyllを使っているプロジェクトで
bundle update
したらローカル環境で実行時にエラーが発生した ibcurl4-openssl-dev
をUbuntuにインストールすることで解消した
ことの始まり
先日こんなメールがGitHubから届きました。
「これが噂のDependency graphの機能で脆弱性のあるライブラリを通知してくれているのかー最高に便利だな」と思いました。
ということでアップデートを開始。
環境
今回問題が発生した環境は以下です。
やったこと
Gemfileの確認
GitHub Pagesのgemはこんな感じになっていると思います。
source "https://rubygems.org" gem 'github-pages', group: :jekyll_plugins
bundle updateの実施
アップデートします。
$ > bundle update
何のエラーもなくアップデートできました。Gemfile.lock
もきちんと更新され、中を見ると問題のnokogiri もアップデートされていることを確認しました。
動作確認、エラー発生
ローカルで動作確認をします。
$ > bundle exec jekyll serve Configuration file: /mnt/c/Users/xxx/xxx/_config.yml Dependency Error: Yikes! It looks like you don't have jekyll-remote-theme or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. Could not open library 'libcurl.so': libcurl.so: cannot open shared object file: No such file or directory. Could not open library 'libcurl.so.4': libcurl.so.4: cannot open shared object file: No such file or directory' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/! jekyll 3.6.2 | Error: jekyll-remote-theme
おや、なんかエラーが出てる。Error: jekyll-remote-theme
ってやつですね。
対応策
調べたところjekyllのリポジトリにそれっぽいIssueが上がっているのを見つけました。
Dependency Error: jekyll-remote-theme is not installed · Issue #6660 · jekyll/jekyll
まさにこれですね。
いろいろ書かれていますが、私の環境では下の方にあるようにibcurl4-openssl-dev
を入れることで解決しました。
$ > sudo apt install libcurl4-openssl-dev
これでもう一度、bundle exec jekyll serve
を実行したところエラーが解消されました。
さいごに
あとはPushすれば無事にGitHubが出しているセキュリティアラートも消えていると思います。
しかし、Dependency graph便利ですね。もっと色んな言語に対応してくれるとありがたいものです。