termuxで「msfconsoleとバンドルのインストール」を実行中にエラーが発生しました。 - Android

termuxで「msfconsoleとバンドルのインストール」を実行中にエラーが発生しました。 - Android

"bundle install"コマンドの実行中に、次のエラーが発生します。

だから "msfconsole"を実行し、次のようになります。

   $ msfconsole                                    waiting for server to shut down....2019-05-08 11:04:55.057 AEST [14797] LOG:  received fast shutdown request
2019-05-08 11:04:55.058 AEST [14797] LOG:  aborting any active transactions
2019-05-08 11:04:55.059 AEST [14797] LOG:  background worker "logical replication launcher" (PID 14807) exited with exit code 1
2019-05-08 11:04:55.060 AEST [14802] LOG:  shutting down
2019-05-08 11:04:55.091 AEST [14797] LOG:  database system is shut down
 done
server stopped
waiting for server to start....2019-05-08 11:04:55.204 AEST [17104] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2019-05-08 11:04:55.204 AEST [17104] LOG:  listening on Unix socket "/data/data/com.termux/files/usr/tmp/.s.PGSQL.5432"
2019-05-08 11:04:55.221 AEST [17108] LOG:  database system was shut down at 2019-05-08 11:04:55 AEST
2019-05-08 11:04:55.226 AEST [17104] LOG:  database system is ready to accept connections
 done
server started

Could not find nokogiri-1.10.1 in any of the sources
    Run `bundle install` to install missing gems.

その後、「バンドルのインストール」を実行し、次のようになります。

$ bundle install                                The Gemfile specifies no dependencies
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$

「nokogiri」もインストールしようとしましたが、3つのエラーが発生しました。

    $install nokogiri                          Building native extensions. This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    current directory: /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.3/ext/nokogiri
/data/data/com.termux/files/usr/bin/ruby -I /data/data/com.termux/files/usr/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190508-18809-1xe5kij.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
Static linking is disabled.
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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.
To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/extensions/aarch64-linux/2.6.0/nokogiri-1.10.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.3 for inspection.
Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/extensions/aarch64-linux/2.6.0/nokogiri-1.10.3/gem_make.out
$

なぜこれが起こるのですか?どうすれば解決できますか?

ベストアンサー1

zlib開発パッケージをインストールする必要があります。

pkg install zlib-dev

おすすめ記事