bundle install でnokogiriが入りません!
解決済
回答 1
投稿
- 評価
- クリップ 1
- VIEW 1,638
前提・実現したいこと
bundle installができません。
サイトに乗っていることはだいたい試したのですが。。。
はあ。。。。
どなたかわかる方いらっしゃいませんでしょうか。。。
発生している問題・エラーメッセージ
vagrant@vagrant:/vagrant/slow$ bundle install --path=vendor/bundle
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.3
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Fetching nokogiri 1.10.3
Installing nokogiri 1.10.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri
/home/vagrant/.rbenv/versions/2.5.2/bin/ruby -I /home/vagrant/.rbenv/versions/2.5.2/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190425-12443-1jrkrji.rb extconf.rb --use-system-libraries\ --with-xml2-include
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.9
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Remove-script-macro-support.patch
- 0003-Update-entities-to-remove-handling-of-ssi.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
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
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.9.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.9... OK
Running git apply with /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/patches/libxml2/0002-Remove-script-macro-support.patch... OK
Running git apply with /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK
Running 'configure' for libxml2 2.9.9... OK
Running 'compile' for libxml2 2.9.9... OK
Running 'install' for libxml2 2.9.9... OK
Activating libxml2 2.9.9 (from /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ports/x86_64-pc-linux-gnu/libxml2/2.9.9)...
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxslt-1.1.33
with the following patches applied:
- 0001-Fix-security-framework-bypass.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
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Extracting libxslt-1.1.33.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.33... OK
Running git apply with /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/patches/libxslt/0001-Fix-security-framework-bypass.patch... OK
Running 'configure' for libxslt 1.1.33... OK
Running 'compile' for libxslt 1.1.33... OK
Running 'install' for libxslt 1.1.33... OK
Activating libxslt 1.1.33 (from /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ports/x86_64-pc-linux-gnu/libxslt/1.1.33)...
checking for -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes
checking for exsltFuncRegister() in libexslt/exslt.h... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
current directory: /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri
make "DESTDIR=" clean
current directory: /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri
make "DESTDIR="
compiling html_document.c
compiling html_element_description.c
compiling html_entity_lookup.c
compiling html_sax_parser_context.c
compiling html_sax_push_parser.c
compiling nokogiri.c
compiling xml_attr.c
compiling xml_attribute_decl.c
compiling xml_cdata.c
compiling xml_comment.c
compiling xml_document.c
compiling xml_document_fragment.c
compiling xml_dtd.c
compiling xml_element_content.c
compiling xml_element_decl.c
compiling xml_encoding_handler.c
compiling xml_entity_decl.c
compiling xml_entity_reference.c
compiling xml_io.c
compiling xml_libxml2_hacks.c
compiling xml_namespace.c
compiling xml_node.c
xml_node.c: In function ‘reparent_node_with’:
xml_node.c:304:15: warning: passing argument 1 of ‘xmlFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
xmlFree(reparentee->ns->prefix);
^
xml_node.c:304:15: note: expected ‘void *’ but argument is of type ‘const xmlChar * {aka const unsigned char *}’
xml_node.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
compiling xml_node_set.c
compiling xml_processing_instruction.c
compiling xml_reader.c
compiling xml_relax_ng.c
compiling xml_sax_parser.c
compiling xml_sax_parser_context.c
compiling xml_sax_push_parser.c
compiling xml_schema.c
compiling xml_syntax_error.c
compiling xml_text.c
compiling xml_xpath_context.c
compiling xslt_stylesheet.c
xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function]
static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...)
^
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
linking shared-object nokogiri/nokogiri.so
Cleaning files only used during build.
rm -rf /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports
rm -rf /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ports
current directory: /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/ext/nokogiri
make "DESTDIR=" install
/usr/bin/install -c -m 0755 nokogiri.so ./.gem.20190425-12443-5yudz0/nokogiri
/usr/bin/install: setting permissions for ‘./.gem.20190425-12443-5yudz0/nokogiri/nokogiri.so’: Operation not permitted
Makefile:187: recipe for target 'install-so' failed
make: *** [install-so] Error 1
make install failed, exit code 2
Gem files will remain installed in /vagrant/slow/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3 for inspection.
Results logged to /vagrant/slow/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/nokogiri-1.10.3/gem_make.out
An error occurred while installing nokogiri (1.10.3), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.10.3' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 5.2.3, which depends on
actioncable was resolved to 5.2.3, which depends on
actionpack was resolved to 5.2.3, which depends on
actionview was resolved to 5.2.3, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri
試したこと
undlerでビルドオプションを指定する
UbuntuにXML::LibXMLを入れる
nokogiri を嫌いにならないで 〜インストール時のエラーを乗り越えろ〜
補足情報(FW/ツールのバージョンなど)
vagrant@vagrant:/vagrant/slow$ ruby -v
ruby 2.5.2p104 (2018-10-18 revision 65133) [x86_64-linux]
vagrant@vagrant:/vagrant/slow$ bundle -v
Bundler version 2.0.1
vagrant@vagrant:/vagrant/slow$ bundle config
Settings are listed in order of priority. The top value will be used.
path
Set for your local app (/vagrant/slow/.bundle/config): "vendor/bundle"
Set for the current user (/home/vagrant/.bundle/config): "vendor/bundle"
build.nokogiri
Set for the current user (/home/vagrant/.bundle/config): "--use-system-libraries --with-xml2-include"
ここにより詳細な情報を記載してください。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
Operation not permitted
のところがエラーの主な原因のように見えます。
vagrantなので、ホストOS側との権限がややこしいことになっているかもしれないです。sudo bundle installでも同じですかね?
あとはpath指定を変えてみるとか。(/vagrant の下以外にする)
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.37%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
2019/07/29 21:32