環境
Ubuntu 18.04 LTS
rbenv 1.1.2-11-gc46a970
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Bundler version 2.0.2
gem version 2.7.6
質問
bundle installをしたときにnokogiriの箇所でエラーが生じてしまいました。
どんな些細なことでもよいので、教えてくださるとうれしいです。
nokogiriについて
wsl
1$ gem install nokogiri -v '1.10.7' 2Building native extensions. This could take a while... 3/home/jack/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /home/jack/.rbenv/versions/2.5.1 in PATH, mode 040777 4ERROR: Error installing nokogiri: 5 ERROR: Failed to build gem native extension. 6 7 current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 8/home/jack/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20191219-27974-xgexs9.rb extconf.rb 9checking if the C compiler accepts ... yes 10Building nokogiri using packaged libraries. 11Using mini_portile version 2.4.0 12checking for gzdopen() in -lz... yes 13checking for iconv... yes 14************************************************************************ 15IMPORTANT NOTICE: 16 17Building Nokogiri with a packaged version of libxml2-2.9.10 18with the following patches applied: 19 - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch 20 - 0002-Remove-script-macro-support.patch 21 - 0003-Update-entities-to-remove-handling-of-ssi.patch 22 - 0004-libxml2.la-is-in-top_builddir.patch 23 24Team Nokogiri will keep on doing their best to provide security 25updates in a timely manner, but if this is a concern for you and want 26to use the system library instead; abort this installation process and 27reinstall nokogiri as follows: 28 29 gem install nokogiri -- --use-system-libraries 30 [--with-xml2-config=/path/to/xml2-config] 31 [--with-xslt-config=/path/to/xslt-config] 32 33If you are using Bundler, tell it to use the option: 34 35 bundle config build.nokogiri --use-system-libraries 36 bundle install 37 38Note, however, that nokogiri is not fully compatible with arbitrary 39versions of libxml2 provided by OS/package vendors. 40************************************************************************ 41Extracting libxml2-2.9.10.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.10... OK 42Running git apply with /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK 43Running git apply with /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/patches/libxml2/0002-Remove-script-macro-support.patch... OK 44Running git apply with /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK 45Running git apply with /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK 46Running 'configure' for libxml2 2.9.10... OK 47Running 'compile' for libxml2 2.9.10... OK 48Running 'install' for libxml2 2.9.10... OK 49Activating libxml2 2.9.10 (from /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ports/x86_64-pc-linux-gnu/libxml2/2.9.10)... 50************************************************************************ 51IMPORTANT NOTICE: 52 53Building Nokogiri with a packaged version of libxslt-1.1.34. 54 55Team Nokogiri will keep on doing their best to provide security 56updates in a timely manner, but if this is a concern for you and want 57to use the system library instead; abort this installation process and 58reinstall nokogiri as follows: 59 60 gem install nokogiri -- --use-system-libraries 61 [--with-xml2-config=/path/to/xml2-config] 62 [--with-xslt-config=/path/to/xslt-config] 63 64If you are using Bundler, tell it to use the option: 65 66 bundle config build.nokogiri --use-system-libraries 67 bundle install 68************************************************************************ 69Extracting libxslt-1.1.34.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34... OK 70Running 'configure' for libxslt 1.1.34... OK 71Running 'compile' for libxslt 1.1.34... OK 72Running 'install' for libxslt 1.1.34... OK 73Activating libxslt 1.1.34 (from /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ports/x86_64-pc-linux-gnu/libxslt/1.1.34)... 74checking for -llzma... no 75checking for xmlParseDoc() in libxml/parser.h... yes 76checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes 77checking for exsltFuncRegister() in libexslt/exslt.h... yes 78checking for xmlHasFeature()... yes 79checking for xmlFirstElementChild()... yes 80checking for xmlRelaxNGSetParserStructuredErrors()... yes 81checking for xmlRelaxNGSetParserStructuredErrors()... yes 82checking for xmlRelaxNGSetValidStructuredErrors()... yes 83checking for xmlSchemaSetValidStructuredErrors()... yes 84checking for xmlSchemaSetParserStructuredErrors()... yes 85creating Makefile 86 87current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 88make "DESTDIR=" clean 89 90current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 91make "DESTDIR=" 92compiling html_document.c 93compiling html_element_description.c 94compiling html_entity_lookup.c 95compiling html_sax_parser_context.c 96compiling html_sax_push_parser.c 97compiling nokogiri.c 98compiling xml_attr.c 99compiling xml_attribute_decl.c 100compiling xml_cdata.c 101compiling xml_comment.c 102compiling xml_document.c 103compiling xml_document_fragment.c 104compiling xml_dtd.c 105compiling xml_element_content.c 106compiling xml_element_decl.c 107compiling xml_encoding_handler.c 108compiling xml_entity_decl.c 109compiling xml_entity_reference.c 110compiling xml_io.c 111compiling xml_libxml2_hacks.c 112compiling xml_namespace.c 113compiling xml_node.c 114xml_node.c: In function ‘reparent_node_with’: 115xml_node.c:304:15: warning: passing argument 1 of ‘xmlFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 116 xmlFree(reparentee->ns->prefix); 117 ^~~~~~~~~~ 118xml_node.c:304:15: note: expected ‘void *’ but argument is of type ‘const xmlChar * {aka const unsigned char *}’ 119xml_node.c: At top level: 120cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 121cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 122cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 123compiling xml_node_set.c 124compiling xml_processing_instruction.c 125compiling xml_reader.c 126compiling xml_relax_ng.c 127compiling xml_sax_parser.c 128compiling xml_sax_parser_context.c 129compiling xml_sax_push_parser.c 130compiling xml_schema.c 131compiling xml_syntax_error.c 132compiling xml_text.c 133compiling xml_xpath_context.c 134compiling xslt_stylesheet.c 135xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function] 136 static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...) 137 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 139cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 140cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 141linking shared-object nokogiri/nokogiri.so 142Cleaning files only used during build. 143rm -rf /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports 144rm -rf /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ports 145 146current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 147make "DESTDIR=" install 148/usr/bin/install -c -m 0755 nokogiri.so ./.gem.20191219-27974-lm28kf/nokogiri 149 150Permission denied @ rb_file_s_rename - (./.gem.20191219-27974-lm28kf/nokogiri, /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7/nokogiri) 151 152Gem files will remain installed in /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7 for inspection. 153Results logged to /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7/gem_make.out
$ gem install nokogiri -v '1.10.7'のエラーについて、考えたこと
wsl
1/home/jack/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /home/jack/.rbenv/versions/2.5.1 in PATH, mode 040777 2ERROR: Error installing nokogiri: 3 ERROR: Failed to build gem native extension.
このエラーはこちらのサイトで述べられているように、あまり問題ではないと思います。
wsl
1If you are using Bundler, tell it to use the option: 2 3 bundle config build.nokogiri --use-system-libraries 4 bundle install 5 6Note, however, that nokogiri is not fully compatible with arbitrary 7versions of libxml2 provided by OS/package vendors.
$ bundle config build.nokogiri --use-system-libraries
この部分はしっかり記述できました。
$ cat ~/.bundle/config BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries"
libxml2が問題なのかなと思ったのですが、
wsl
1$ sudo apt install libxml2 2Reading package lists... Done 3Building dependency tree 4Reading state information... Done 5libxml2 is already the newest version (2.9.4+dfsg1-6.1ubuntu1.2). 6libxml2 set to manually installed. 70 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
問題なさそうです。
どうぞよろしくお願いします。
回答5件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。