LoginSignup
1
1

More than 5 years have passed since last update.

CircleCI 1.0 で Ruby の pcaprub のインストールに失敗するとき

Posted at

TL;DR

libpcap-dev をインストールすれば良い。

dependencies:
  pre:
    - sudo apt-get install libpcap-dev

背景

bundle install が以下のようなエラーでコケるようになってしまった。
Ubuntu 12.04 から Ubuntu 14.04 に切り替えたタイミングでエラーが起きるようになった。

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

current directory:
/home/ubuntu/dns/vendor/bundle/ruby/2.4.0/gems/pcaprub-0.12.4/ext/pcaprub_c
/opt/circleci/ruby/ruby-2.4.1/bin/ruby -r ./siteconf20170413-11999-vviegb.rb
extconf.rb

[*] Running checks for pcaprub_c code...
platform is x86_64-linux
checking for ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for pcap_open_live() in -lpcap... no
checking for pcap_setnonblock() in -lpcap... no
creating Makefile

current directory:
/home/ubuntu/dns/vendor/bundle/ruby/2.4.0/gems/pcaprub-0.12.4/ext/pcaprub_c
make "DESTDIR=" clean

current directory:
/home/ubuntu/dns/vendor/bundle/ruby/2.4.0/gems/pcaprub-0.12.4/ext/pcaprub_c
make "DESTDIR="
compiling pcaprub.c
pcaprub.c:11:18: fatal error: pcap.h: No such file or directory
 #include <pcap.h>
                  ^
compilation terminated.
make: *** [pcaprub.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/ubuntu/dns/vendor/bundle/ruby/2.4.0/gems/pcaprub-0.12.4 for inspection.
Results logged to
/home/ubuntu/dns/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/pcaprub-0.12.4/gem_make.out

An error occurred while installing pcaprub (0.12.4), and Bundler cannot
continue.
Make sure that `gem install pcaprub -v '0.12.4'` succeeds before bundling.

bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3  returned exit code 5

Action failed: bundle install

調べたところ libpcap をインストールせよとのことだった。
https://github.com/pcaprub/pcaprub/issues/49

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1