fluent-plugins-nursery / fluent-plugin-systemd

This is a fluentd input plugin. It reads logs from the systemd journal.
Apache License 2.0
153 stars 43 forks source link

Can't install version "0.0.8" #44

Closed akensho closed 6 years ago

akensho commented 6 years ago

Environment

$cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS
$/opt/td-agent/embedded/bin/ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
$td-agent --version
td-agent 0.12.40

Detail I've tried $td-agent-gem install fluent-plugin-systemd -v 0.0.8 the above environment.

The result is bellow.

$td-agent-gem install fluent-plugin-systemd -v 0.0.8
Building native extensions.  This could take a while...
ERROR:  Error installing fluent-plugin-systemd:
    ERROR: Failed to build gem native extension.

    current directory: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/ffi-1.9.18/ext/ffi_c
/opt/td-agent/embedded/bin/ruby -r ./siteconf20171006-9010-thi6l0.rb extconf.rb
checking for ffi.h... *** 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
    --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=/opt/td-agent/embedded/bin/ruby
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:598:in `try_cpp'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:1072:in `block in have_header'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:923:in `block in checking_for'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:922:in `checking_for'
    from /opt/td-agent/embedded/lib/ruby/2.1.0/mkmf.rb:1071:in `have_header'
    from extconf.rb:16:in `<main>'

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

  /opt/td-agent/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.18/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/ffi-1.9.18 for inspection.
Results logged to /opt/td-agent/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.18/gem_make.out

This is mkmf.log.

$cat /opt/td-agent/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.18/mkmf.log
package configuration for libffi is not found
"gcc -o conftest -I/opt/td-agent/embedded/include/ruby-2.1.0/x86_64-linux -I/opt/td-agent/embedded/include/ruby-2.1.0/ruby/backward -I/opt/td-agent/embedded/include/ruby-2.1.0 -I. -I/opt/td-agent/embedded/include -O2 -O3 -g -pipe -I/opt/td-agent/embedded/include   -I/opt/td-agent/embedded/include -O2 -O3 -g -pipe -fPIC conftest.c  -L. -L/opt/td-agent/embedded/lib -Wl,-R/opt/td-agent/embedded/lib -L/opt/td-agent/embedded/lib -Wl,-R/opt/td-agent/embedded/lib -L. -Wl,-rpath,/opt/td-agent/embedded/lib -fstack-protector -L/opt/td-agent/embedded/lib -rdynamic -Wl,-export-dynamic -L/opt/td-agent/embedded/lib  -Wl,-R/opt/td-agent/embedded/lib      -Wl,-R -Wl,/opt/td-agent/embedded/lib -L/opt/td-agent/embedded/lib -lruby  -lpthread -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

According to the log, I think I should install some libraries and set to correct configuration. What should I do as a next step?

errm commented 6 years ago

I think on ubuntu you need to install the build-essential package to get the build tools

akensho commented 6 years ago

Thank you for your help! This is bonehead issue (´◉◞౪◟◉)