RubyGem "gobject-introspection" が Linux Mint にインストールできない
Linux Mint 19.3 に gem "gtk2" をインストールしようとしてハマりました。
Fetching gobject-introspection 3.4.1 Installing gobject-introspection 3.4.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/tomoki/Documents/Ruby265/vendor/bundle/ruby/2.6.0/gems/gobject-introspection-3.4.1/ext/gobject-introspection /home/tomoki/.rbenv/versions/2.6.5/bin/ruby -I /home/tomoki/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200306-4424-xngtrx.rb extconf.rb checking for --enable-debug-build option... no checking for -Wall option to compiler... yes checking for -Waggregate-return option to compiler... yes checking for -Wcast-align option to compiler... yes checking for -Wextra option to compiler... yes checking for -Wformat=2 option to compiler... yes checking for -Winit-self option to compiler... yes checking for -Wlarger-than-65500 option to compiler... yes checking for -Wmissing-declarations option to compiler... yes checking for -Wmissing-format-attribute option to compiler... yes checking for -Wmissing-include-dirs option to compiler... yes checking for -Wmissing-noreturn option to compiler... yes checking for -Wmissing-prototypes option to compiler... yes checking for -Wnested-externs option to compiler... no checking for -Wold-style-definition option to compiler... yes checking for -Wpacked option to compiler... yes checking for -Wp,-D_FORTIFY_SOURCE=2 option to compiler... yes checking for -Wpointer-arith option to compiler... yes checking for -Wundef option to compiler... yes checking for -Wout-of-line-declaration option to compiler... no checking for -Wunsafe-loop-optimizations option to compiler... yes checking for -Wwrite-strings option to compiler... yes checking for Homebrew... no checking for gobject-introspection-1.0... no *** 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/tomoki/.rbenv/versions/2.6.5/bin/$(RUBY_BASE_NAME) --enable-debug-build --disable-debug-build --with-pkg-config --without-pkg-config --with-override-variables --without-override-variables To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/tomoki/Documents/Ruby265/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/gobject-introspection-3.4.1/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/tomoki/Documents/Ruby265/vendor/bundle/ruby/2.6.0/gems/gobject-introspection-3.4.1 for inspection. Results logged to /home/tomoki/Documents/Ruby265/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/gobject-introspection-3.4.1/gem_make.out An error occurred while installing gobject-introspection (3.4.1), and Bundler cannot continue. Make sure that `gem install gobject-introspection -v '3.4.1' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: gio2 was resolved to 3.4.1, which depends on gobject-introspection
パッケージがないのかと思って apt-get install してみましたが、
$ sudo apt-get install -y gobject-introspection パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 gobject-introspection はすでに最新バージョン (1.56.1-1) です。
という感じ。
正解はここにありました。
$ sudo apt install libgirepository1.0-dev
これで OK。