質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
rbenv

rbenvは、Rubyバージョン管理ツール。プロジェクトごとでRubyバージョンを切り替えることが可能です。RVMよりもシンプルで、少ない機能で動作します。本体にはRubyのビルド機能は備わっておらず、ruby-buildというツールを用いる必要があります。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

解決済

5回答

1455閲覧

bundle installのエラーを解決したいです!!

jack_kanzaki

総合スコア106

rbenv

rbenvは、Rubyバージョン管理ツール。プロジェクトごとでRubyバージョンを切り替えることが可能です。RVMよりもシンプルで、少ない機能で動作します。本体にはRubyのビルド機能は備わっておらず、ruby-buildというツールを用いる必要があります。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2019/12/19 02:36

環境

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.

問題なさそうです。

どうぞよろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答5

0

自己解決

パソコンを初期状態にし、アンインストールしもう一度やり直した結果、bundle installすることは可能になりました。
尚、原因に関しては究明できなかったので、もし何か解決方法を思いついた方がいらっしゃったら、よろしくお願いします。

投稿2019/12/31 08:54

jack_kanzaki

総合スコア106

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

Results 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
こちらを記載させていただきます。

wsl

1~/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7$ cat gem_make.out 2current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 3/home/jack/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20191219-9200-6226zd.rb extconf.rb --use-system-libraries 4checking if the C compiler accepts ... yes 5Building nokogiri using system libraries. 6checking for xmlParseDoc() in libxml/parser.h... yes 7checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes 8checking for exsltFuncRegister() in libexslt/exslt.h... yes 9checking for xmlHasFeature()... yes 10checking for xmlFirstElementChild()... yes 11checking for xmlRelaxNGSetParserStructuredErrors()... yes 12checking for xmlRelaxNGSetParserStructuredErrors()... yes 13checking for xmlRelaxNGSetValidStructuredErrors()... yes 14checking for xmlSchemaSetValidStructuredErrors()... yes 15checking for xmlSchemaSetParserStructuredErrors()... yes 16creating Makefile 17 18current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 19make "DESTDIR=" clean 20 21current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 22make "DESTDIR=" 23compiling html_document.c 24compiling html_element_description.c 25compiling html_entity_lookup.c 26compiling html_sax_parser_context.c 27compiling html_sax_push_parser.c 28compiling nokogiri.c 29compiling xml_attr.c 30compiling xml_attribute_decl.c 31compiling xml_cdata.c 32compiling xml_comment.c 33compiling xml_document.c 34compiling xml_document_fragment.c 35compiling xml_dtd.c 36xml_dtd.c: In function ‘entities’: 37xml_dtd.c:47:47: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type [-Wincompatible-pointer-types] 38 xmlHashScan((xmlHashTablePtr)dtd->entities, element_copier, (void *)hash); 39 ^~~~~~~~~~~~~~ 40In file included from /usr/include/libxml2/libxml/parser.h:18:0, 41 from ./nokogiri.h:19, 42 from ./xml_dtd.h:4, 43 from xml_dtd.c:1: 44/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, void *, const unsigned char *)}’ 45 xmlHashScan (xmlHashTablePtr table, 46 ^~~~~~~~~~~ 47xml_dtd.c: In function ‘notations’: 48xml_dtd.c:69:48: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type [-Wincompatible-pointer-types] 49 xmlHashScan((xmlHashTablePtr)dtd->notations, notation_copier, (void *)hash); 50 ^~~~~~~~~~~~~~~ 51In file included from /usr/include/libxml2/libxml/parser.h:18:0, 52 from ./nokogiri.h:19, 53 from ./xml_dtd.h:4, 54 from xml_dtd.c:1: 55/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, void *, const unsigned char *)}’ 56 xmlHashScan (xmlHashTablePtr table, 57 ^~~~~~~~~~~ 58xml_dtd.c: In function ‘attributes’: 59xml_dtd.c:91:49: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type [-Wincompatible-pointer-types] 60 xmlHashScan((xmlHashTablePtr)dtd->attributes, element_copier, (void *)hash); 61 ^~~~~~~~~~~~~~ 62In file included from /usr/include/libxml2/libxml/parser.h:18:0, 63 from ./nokogiri.h:19, 64 from ./xml_dtd.h:4, 65 from xml_dtd.c:1: 66/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, void *, const unsigned char *)}’ 67 xmlHashScan (xmlHashTablePtr table, 68 ^~~~~~~~~~~ 69xml_dtd.c: In function ‘elements’: 70xml_dtd.c:113:47: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type [-Wincompatible-pointer-types] 71 xmlHashScan((xmlHashTablePtr)dtd->elements, element_copier, (void *)hash); 72 ^~~~~~~~~~~~~~ 73In file included from /usr/include/libxml2/libxml/parser.h:18:0, 74 from ./nokogiri.h:19, 75 from ./xml_dtd.h:4, 76 from xml_dtd.c:1: 77/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, void *, const unsigned char *)}’ 78 xmlHashScan (xmlHashTablePtr table, 79 ^~~~~~~~~~~ 80xml_dtd.c: At top level: 81cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 82cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 83cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 84compiling xml_element_content.c 85compiling xml_element_decl.c 86compiling xml_encoding_handler.c 87compiling xml_entity_decl.c 88compiling xml_entity_reference.c 89compiling xml_io.c 90compiling xml_libxml2_hacks.c 91compiling xml_namespace.c 92compiling xml_node.c 93xml_node.c: In function ‘reparent_node_with’: 94xml_node.c:304:15: warning: passing argument 1 of ‘xmlFree’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 95 xmlFree(reparentee->ns->prefix); 96 ^~~~~~~~~~ 97xml_node.c:304:15: note: expected ‘void *’ but argument is of type ‘const xmlChar * {aka const unsigned char *}’ 98xml_node.c: At top level: 99cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 100cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 101cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 102compiling xml_node_set.c 103compiling xml_processing_instruction.c 104compiling xml_reader.c 105compiling xml_relax_ng.c 106compiling xml_sax_parser.c 107compiling xml_sax_parser_context.c 108compiling xml_sax_push_parser.c 109compiling xml_schema.c 110compiling xml_syntax_error.c 111compiling xml_text.c 112compiling xml_xpath_context.c 113compiling xslt_stylesheet.c 114xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function] 115 static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...) 116 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 118cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 119cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 120linking shared-object nokogiri/nokogiri.so 121Cleaning files only used during build. 122rm -rf /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ports/archives 123 124current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 125make "DESTDIR=" install 126/usr/bin/install -c -m 0755 nokogiri.so ./.gem.20191219-9200-bmmfhb/nokogiri 127 128Permission denied @ rb_file_s_rename - (./.gem.20191219-9200-bmmfhb/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)

投稿2019/12/19 10:18

jack_kanzaki

総合スコア106

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

この方法で同でしょうか?

https://qiita.com/pugiemonn/items/4b23a709ed194b02be6d

たしかnokogiriがバージョンアップしたことによる不具合だった記憶があります

投稿2019/12/19 03:12

story_aniki

総合スコア197

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jack_kanzaki

2019/12/19 03:17

bundle configについてだと思われるのですが、おそらく違うことが原因かもしれません。 出先なので、あとで実行させていただきます。 ご指摘ありがとうごさいます。 他にも、不具合箇所で改善すべきところがあれば、教えていただけると幸いです!
guest

0

最後の3行ですが
まず
Permission 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)
とあるのが気になります。jack でloginしてやってますよね?

Results 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

に多分有用な情報があります。それをひとまず参考にして試してください。

それとは別にモウ一点
bundle config build.nokogiri --use-system-libraries
bundle install
してみろ、というのがありますが、これは試しました?

投稿2019/12/19 02:44

winterboum

総合スコア23284

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jack_kanzaki

2019/12/19 02:45

早速のお返事ありがとうございます。 それとは別にモウ一点 bundle config build.nokogiri --use-system-libraries bundle install してみろ、というのがありますが、これは試しました? こちらは試しました。
jack_kanzaki

2019/12/19 02:57

まず Permission 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) とあるのが気になります。jack でloginしてやってますよね? はい
jack_kanzaki

2019/12/19 02:58

Results 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 に多分有用な情報があります。それをひとまず参考にして試してください。 こちらを参考にしてみます。
winterboum

2019/12/19 10:27

gem_make.outをみると、nokogiriのcompileは終了し、 /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 に移すところで権限がない、というエラーとなっています。 よもやとは思いますが /home/jack にcdして ls -l .rbenv ls -l .rbenv/versions ls -l .rbenv/versions/2.5.1 ls -l .rbenv/versions/2.5.1/lib ls -l .rbenv/versions/2.5.1/lib/ruby ls -l .rbenv/versions/2.5.1/lib/ruby/gems ls -l .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0 ls -l .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions ls -l .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux ls -l .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0 ls -l .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.7 の結果を見せてください
jack_kanzaki

2019/12/19 11:20

~/.rbenv/versions/2.5.1/lib/ruby/2.5.0$ ls -a . drb.rb kconv.rb pathname.rb ripper.rb time.rb .. e2mmap.rb logger.rb pp.rb rss timeout.rb English.rb erb.rb matrix prettyprint.rb rss.rb tmpdir.rb abbrev.rb expect.rb matrix.rb prime.rb rubygems tracer.rb base64.rb fiddle mkmf.rb profile.rb rubygems.rb tsort.rb benchmark.rb fiddle.rb monitor.rb profiler.rb scanf.rb un.rb bigdecimal fileutils.rb mutex_m.rb pstore.rb securerandom.rb unicode_normalize cgi find.rb net psych set.rb uri cgi.rb forwardable observer.rb psych.rb shell uri.rb cmath.rb forwardable.rb open-uri.rb racc shell.rb weakref.rb csv.rb getoptlong.rb open3.rb rdoc shellwords.rb webrick date.rb io openssl rdoc.rb singleton.rb webrick.rb debug.rb ipaddr.rb openssl.rb resolv-replace.rb socket.rb x86_64-linux delegate.rb irb optionparser.rb resolv.rb sync.rb yaml digest irb.rb optparse rexml syslog yaml.rb digest.rb json optparse.rb rinda tempfile.rb drb json.rb ostruct.rb ripper thwait.rb
jack_kanzaki

2019/12/19 11:54 編集

$ ls -l .rbenv/versions/2.5.1/lib/ruby/2.5.0 このコマンドを打った時にextentionsというディレクトが存在しないことに気づきました。 gemsというディレクトリを忘れていたので、下記で訂正させていただいております。
jack_kanzaki

2019/12/19 11:23

解決方法を自分でも考えてみます。 ご回答、ありがとうございます。 加えて、ご助言をしていただけると幸いです。
winterboum

2019/12/19 11:27

これらのdirは自動で作られるものではないかと思うのですが、とりあえずの逃げとして mkdir -p .rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0 を行ってからまたbundle install してみてください
jack_kanzaki

2019/12/19 11:51

すみません。誤りでした。
jack_kanzaki

2019/12/19 11:51

~/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0$ ls -l total 0 drwxr-xr-x 1 jack jack 4096 nokogiri-1.10.7
jack_kanzaki

2019/12/19 11:52

最後の2.5.0というディレクトリの権限が777だったので、 $ chmod 755 2.5.0としました。
winterboum

2019/12/19 13:56

で、どうなりました?
jack_kanzaki

2019/12/19 23:25

まだ、動かないままです。 アンインストールして、リトライします。
guest

0

字数オーバーのため、こちらにbundle installの結果を書かせていただきます。

wsl

1$ bundle install 2The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. 3Fetching gem metadata from https://rubygems.org/............ 4Using rake 13.0.1 5Using concurrent-ruby 1.1.5 6Using i18n 1.7.0 7Using minitest 5.13.0 8Using thread_safe 0.3.6 9Using tzinfo 1.2.5 10Using activesupport 5.2.4 11Using builder 3.2.4 12Using erubi 1.9.0 13Using mini_portile2 2.4.0 14Fetching nokogiri 1.10.7 15Installing nokogiri 1.10.7 with native extensions 16Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 17 18current directory: 19/home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 20/home/jack/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20191219-25381-1h6tf62.rb extconf.rb 21--use-system-libraries 22checking if the C compiler accepts ... yes 23Building nokogiri using system libraries. 24checking for xmlParseDoc() in libxml/parser.h... yes 25checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes 26checking for exsltFuncRegister() in libexslt/exslt.h... yes 27checking for xmlHasFeature()... yes 28checking for xmlFirstElementChild()... yes 29checking for xmlRelaxNGSetParserStructuredErrors()... yes 30checking for xmlRelaxNGSetParserStructuredErrors()... yes 31checking for xmlRelaxNGSetValidStructuredErrors()... yes 32checking for xmlSchemaSetValidStructuredErrors()... yes 33checking for xmlSchemaSetParserStructuredErrors()... yes 34creating Makefile 35 36current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 37make "DESTDIR=" clean 38 39current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 40make "DESTDIR=" 41compiling html_document.c 42compiling html_element_description.c 43compiling html_entity_lookup.c 44compiling html_sax_parser_context.c 45compiling html_sax_push_parser.c 46compiling nokogiri.c 47compiling xml_attr.c 48compiling xml_attribute_decl.c 49compiling xml_cdata.c 50compiling xml_comment.c 51compiling xml_document.c 52compiling xml_document_fragment.c 53compiling xml_dtd.c 54xml_dtd.c: In function ‘entities’: 55xml_dtd.c:47:47: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type 56[-Wincompatible-pointer-types] 57 xmlHashScan((xmlHashTablePtr)dtd->entities, element_copier, (void *)hash); 58 ^~~~~~~~~~~~~~ 59In file included from /usr/include/libxml2/libxml/parser.h:18:0, 60 from ./nokogiri.h:19, 61 from ./xml_dtd.h:4, 62 from xml_dtd.c:1: 63/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, 64unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, 65void *, const unsigned char *)}’ 66 xmlHashScan (xmlHashTablePtr table, 67 ^~~~~~~~~~~ 68xml_dtd.c: In function ‘notations’: 69xml_dtd.c:69:48: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type 70[-Wincompatible-pointer-types] 71 xmlHashScan((xmlHashTablePtr)dtd->notations, notation_copier, (void *)hash); 72 ^~~~~~~~~~~~~~~ 73In file included from /usr/include/libxml2/libxml/parser.h:18:0, 74 from ./nokogiri.h:19, 75 from ./xml_dtd.h:4, 76 from xml_dtd.c:1: 77/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, 78unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, 79void *, const unsigned char *)}’ 80 xmlHashScan (xmlHashTablePtr table, 81 ^~~~~~~~~~~ 82xml_dtd.c: In function ‘attributes’: 83xml_dtd.c:91:49: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type 84[-Wincompatible-pointer-types] 85 xmlHashScan((xmlHashTablePtr)dtd->attributes, element_copier, (void *)hash); 86 ^~~~~~~~~~~~~~ 87In file included from /usr/include/libxml2/libxml/parser.h:18:0, 88 from ./nokogiri.h:19, 89 from ./xml_dtd.h:4, 90 from xml_dtd.c:1: 91/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, 92unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, 93void *, const unsigned char *)}’ 94 xmlHashScan (xmlHashTablePtr table, 95 ^~~~~~~~~~~ 96xml_dtd.c: In function ‘elements’: 97xml_dtd.c:113:47: warning: passing argument 2 of ‘xmlHashScan’ from incompatible pointer type 98[-Wincompatible-pointer-types] 99 xmlHashScan((xmlHashTablePtr)dtd->elements, element_copier, (void *)hash); 100 ^~~~~~~~~~~~~~ 101In file included from /usr/include/libxml2/libxml/parser.h:18:0, 102 from ./nokogiri.h:19, 103 from ./xml_dtd.h:4, 104 from xml_dtd.c:1: 105/usr/include/libxml2/libxml/hash.h:209:4: note: expected ‘xmlHashScanner {aka void (*)(void *, void *, 106unsigned char *)}’ but argument is of type ‘void (*)(void *, void *, const xmlChar *) {aka void (*)(void *, 107void *, const unsigned char *)}’ 108 xmlHashScan (xmlHashTablePtr table, 109 ^~~~~~~~~~~ 110xml_dtd.c: At top level: 111cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 112cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 113cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 114compiling xml_element_content.c 115compiling xml_element_decl.c 116compiling xml_encoding_handler.c 117compiling xml_entity_decl.c 118compiling xml_entity_reference.c 119compiling xml_io.c 120compiling xml_libxml2_hacks.c 121compiling xml_namespace.c 122compiling xml_node.c 123xml_node.c: In function ‘reparent_node_with’: 124xml_node.c:304:15: warning: passing argument 1 of ‘xmlFree’ discards ‘const’ qualifier from pointer target 125type [-Wdiscarded-qualifiers] 126 xmlFree(reparentee->ns->prefix); 127 ^~~~~~~~~~ 128xml_node.c:304:15: note: expected ‘void *’ but argument is of type ‘const xmlChar * {aka const unsigned 129char *}’ 130xml_node.c: At top level: 131cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 132cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 133cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 134compiling xml_node_set.c 135compiling xml_processing_instruction.c 136compiling xml_reader.c 137compiling xml_relax_ng.c 138compiling xml_sax_parser.c 139compiling xml_sax_parser_context.c 140compiling xml_sax_push_parser.c 141compiling xml_schema.c 142compiling xml_syntax_error.c 143compiling xml_text.c 144compiling xml_xpath_context.c 145compiling xslt_stylesheet.c 146xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used 147[-Wunused-function] 148 static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...) 149 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 150cc1: warning: unrecognized command line option ‘-Wno-self-assign’ 151cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’ 152cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’ 153linking shared-object nokogiri/nokogiri.so 154Cleaning files only used during build. 155rm -rf /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ports/archives 156 157current directory: /home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7/ext/nokogiri 158make "DESTDIR=" install 159/usr/bin/install -c -m 0755 nokogiri.so ./.gem.20191219-25381-1lh7zk3/nokogiri 160 161Permission denied @ rb_file_s_rename - (./.gem.20191219-25381-1lh7zk3/nokogiri, 162/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) 163 164Gem files will remain installed in 165/home/jack/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/nokogiri-1.10.7 for inspection. 166Results logged to 167/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 168 169An error occurred while installing nokogiri (1.10.7), and Bundler cannot continue. 170Make sure that `gem install nokogiri -v '1.10.7' --source 'https://rubygems.org/'` succeeds before 171bundling. 172 173In Gemfile: 174 rails was resolved to 5.2.4, which depends on 175 actioncable was resolved to 5.2.4, which depends on 176 actionpack was resolved to 5.2.4, which depends on 177 actionview was resolved to 5.2.4, which depends on 178 rails-dom-testing was resolved to 2.0.3, which depends on 179 nokogiri

投稿2019/12/19 02:38

jack_kanzaki

総合スコア106

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問