※当記事は2017年7月9日にDiscordグループ「Mastodon-jp」に投稿されている質問・回答内容のメモ書きです。
動作環境
・CentOS7.3
・<ユーザー名>のディレクトリ直下にliveディレクトリを配置し、その中にMastodonを構築
・Mastodon1.4.7(前提パッケージはインストール済み)
Mastodon1.4.7に更新作業を苦戦して、やっと更新終わらしてbundle installを実行するとこのようなエラーの場合
エラー本文
current directory:
/home/<ユーザー名>/live/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.3/ext/cld3
/home/<ユーザー名>/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20170709-25674-i0yzxc.rb
extconf.rb
Failed to locate protobuf
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/user/.rbenv/versions/2.4.1/bin/$(RUBY_BASE_NAME)
--with-protobuf-config
--without-protobuf-config
--with-pkg-config
--without-pkg-config
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/<ユーザー名>/live/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/cld3-3.1.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/user/<ユーザー名>/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.3 for inspection.
Results logged to
/home/user/<ユーザー名>/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/cld3-3.1.3/gem_make.out
こちらのエラーの場合は
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig
というコマンドを実行したら治りました。
実は、この件が解決してから投稿を後回しにしてたら、先日1.4.7から2.0.0に上げた際にこの症状が再発したので書いときました。(追記:Rubyのアップデート後bundle installをした際にも起きます。)