【Ubuntu】Mastodonでbundle install時にcld3でエラー

Facebook にシェア
Pocket
LINEで送る
このエントリーを Google ブックマーク に追加

Mastodonの構築中に以下のようなエラーになった。
参考はこちら

$ bundle install --deployment --without development test

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/cld3-3.2.2/ext/cld3
/home/mastodon/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20180604-4152-n3wwmr.rb extconf.rb
Failed to locate protobuf

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/mastodon/live/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/cld3-3.2.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/cld3-3.2.2 for inspection.
Results logged to /home/mastodon/live/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/cld3-3.2.2/gem_make.out

An error occurred while installing cld3 (3.2.2), and Bundler cannot continue.
Make sure that `gem install cld3 -v '3.2.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  cld3

以下のパッケージをインストールすることで解消した。

sudo apt-get install libprotobuf-dev libprotoc-dev protobuf-compiler pkg-config