こんなエラー
Installing nokogiri 1.8.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.2/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20180609-8585-1wf897h.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.2 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.8.2/gem_make.out
An error occurred while installing nokogiri (1.8.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.2' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 5.1.4, which depends on
actioncable was resolved to 5.1.4, which depends on
actionpack was resolved to 5.1.4, which depends on
actionview was resolved to 5.1.4, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri
ググった。
https://stackoverflow.com/questions/49692252/installing-nokogiri-1-8-2-for-metaslpoit
下記でコマンドで実行後、再びインストールで成功しました。
sudo apt-get install build-essential liblzma-dev patch ruby-dev zlib1g-dev
これらがインストールされていなかったため、エラーになった。
libgmp-dev libgmpxx4ldbl liblzma-dev ruby-dev ruby2.5-dev ruby2.5-doc
###TODO
インストールできなかった原因のパッケージを調べる