16
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu Rails5 nokogiri 1.8.2 インストール エラー時の解決メモ

Posted at

こんなエラー

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
インストールできなかった原因のパッケージを調べる

16
9
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
16
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?