Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.




インストール時に「nokogiri- for inspection.」というエラーが出て失敗。


# gem install --no-ri --no-rdoc rails
Fetching: thread_safe-0.3.4.gem (100%)
Successfully installed thread_safe-0.3.4
Fetching: minitest-5.5.1.gem (100%)
Successfully installed minitest-5.5.1
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: activesupport-4.2.0.gem (100%)
Successfully installed activesupport-4.2.0
Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%)
Successfully installed rails-deprecated_sanitizer-1.0.3
Fetching: mini_portile-0.6.2.gem (100%)
Successfully installed mini_portile-0.6.2
Fetching: nokogiri- (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    /usr/local/rbenv/versions/2.1.5/bin/ruby -r ./siteconf20150202-16570-18cdxm.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... yes
checking for iconv... yes

Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
        - 0001-Revert-Missing-initialization-for-the-catalog-module.patch
        - 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

    gem install nokogiri -- --use-system-libraries

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2... OK
Running patch with /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-
Running 'patch' for libxml2 2.9.2... ERROR, review '/usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-' to see what happened.
*** 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:
/usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in `block in execute': Failed to complete patch task (RuntimeError)
        from /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `chdir'
        from /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `execute'
        from extconf.rb:311:in `block in patch'
        from extconf.rb:308:in `each'
        from extconf.rb:308:in `patch'
        from /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:108:in `cook'
        from extconf.rb:278:in `block in process_recipe'
        from extconf.rb:177:in `tap'
        from extconf.rb:177:in `process_recipe'
        from extconf.rb:475:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri- for inspection.
Results logged to /usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/nokogiri-



# yum -y install libxml2 libxslt libxml2-devel libxslt-devel
# gem install nokogiri -- --use-system-libraries
# gem install rails



Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What is going on with this article?