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

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

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

Cygwinは、Unixのような環境を、Windows上で構築させるコマンドラインインターフェースです。

Ruby

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

Windows

Windowsは、マイクロソフト社が開発したオペレーティングシステムです。当初は、MS-DOSに変わるOSとして開発されました。 GUIを採用し、主にインテル系のCPUを搭載したコンピューターで動作します。Windows系OSのシェアは、90%を超えるといわれています。 パソコン用以外に、POSシステムやスマートフォンなどの携帯端末用、サーバ用のOSもあります。

Q&A

解決済

2回答

1832閲覧

Ruby gemのgoogle_driveをインストールする際にエラー

d04062

総合スコア111

Cygwin

Cygwinは、Unixのような環境を、Windows上で構築させるコマンドラインインターフェースです。

Ruby

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

Windows

Windowsは、マイクロソフト社が開発したオペレーティングシステムです。当初は、MS-DOSに変わるOSとして開発されました。 GUIを採用し、主にインテル系のCPUを搭載したコンピューターで動作します。Windows系OSのシェアは、90%を超えるといわれています。 パソコン用以外に、POSシステムやスマートフォンなどの携帯端末用、サーバ用のOSもあります。

0グッド

0クリップ

投稿2020/09/12 02:06

Ruby gemのgoogle_driveをインストールする際に下記のようなエラーが出てしまいます。

Winodws内にCygwinを入れてRubyを実行しています。
(WindowsにCygwinをを通さず直接、google_driveをインストールすることはできました)

Cygwinが問題ではないような、nokogiriに関係してそうな感じがしているのですが、
原因が分かっていません。
(Cygwinにnokogiri-1.10.10が入ってます)

アドバイスいただけますと幸いです。

ruby

1$ gem install google_drive 2Building native extensions. This could take a while... 3ERROR: Error installing google_drive: 4 ERROR: Failed to build gem native extension. 5 6 current directory: /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri 7/home/1/.rbenv/versions/2.7.1/bin/ruby.exe -I /home/1/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200912-2067-zu07l7.rb extconf.rb 8checking if the C compiler accepts ... yes 9Building nokogiri using packaged libraries. 10Using mini_portile version 2.4.0 11checking for gzdopen() in -lz... yes 12checking for iconv... yes 13************************************************************************ 14IMPORTANT NOTICE: 15 16Building Nokogiri with a packaged version of libxml2-2.9.10 17with the following patches applied: 18 - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch 19 - 0002-Remove-script-macro-support.patch 20 - 0003-Update-entities-to-remove-handling-of-ssi.patch 21 - 0004-libxml2.la-is-in-top_builddir.patch 22 - 0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.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-cygwin/ports/libxml2/2.9.10... OK 42Running git apply with /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK 43Running git apply with /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0002-Remove-script-macro-support.patch... OK 44Running git apply with /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK 45Running git apply with /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK 46Running git apply with /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch... OK 47Running 'configure' for libxml2 2.9.10... OK 48Running 'compile' for libxml2 2.9.10... OK 49Running 'install' for libxml2 2.9.10... OK 50Activating libxml2 2.9.10 (from /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ports/x86_64-pc-cygwin/libxml2/2.9.10)... 51************************************************************************ 52IMPORTANT NOTICE: 53 54Building Nokogiri with a packaged version of libxslt-1.1.34. 55 56Team Nokogiri will keep on doing their best to provide security 57updates in a timely manner, but if this is a concern for you and want 58to use the system library instead; abort this installation process and 59reinstall nokogiri as follows: 60 61 gem install nokogiri -- --use-system-libraries 62 [--with-xml2-config=/path/to/xml2-config] 63 [--with-xslt-config=/path/to/xslt-config] 64 65If you are using Bundler, tell it to use the option: 66 67 bundle config build.nokogiri --use-system-libraries 68 bundle install 69************************************************************************ 70Extracting libxslt-1.1.34.tar.gz into tmp/x86_64-pc-cygwin/ports/libxslt/1.1.34... OK 71Running 'configure' for libxslt 1.1.34... OK 72Running 'compile' for libxslt 1.1.34... ERROR, review '/home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-pc-cygwin/ports/libxslt/1.1.34/compile.log' to see what happened. Last lines are: 73======================================================================== 74/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(date.o):date.c:(.text+0x738f): undefined reference to `__imp_xsltGenericDebug' 75/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(date.o):date.c:(.text+0x7399): undefined reference to `__imp_xsltGenericDebugContext' 76/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(date.o):date.c:(.text+0x74d5): undefined reference to `__imp_xsltGenericDebug' 77/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(date.o):date.c:(.text+0x74df): undefined reference to `__imp_xsltGenericDebugContext' 78/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(saxon.o):saxon.c:(.text+0x613): undefined reference to `__imp_xsltGenericError' 79/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(saxon.o):saxon.c:(.text+0x61d): undefined reference to `__imp_xsltGenericErrorContext' 80/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(dynamic.o):dynamic.c:(.text+0x4f): undefined reference to `__imp_xsltGenericError' 81/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: ../libexslt/.libs/libexslt.a(dynamic.o):dynamic.c:(.text+0x59): undefined reference to `__imp_xsltGenericErrorContext' 82 83collect2: error: ld returned 1 exit status 84make[2]: *** [Makefile:484: xsltproc.exe] エラー 1 85make[2]: ディレクトリ '/home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-pc-cygwin/ports/libxslt/1.1.34/libxslt-1.1.34/xsltproc' から出ます 86make[1]: *** [Makefile:615: all-recursive] エラー 1 87make[1]: ディレクトリ '/home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-pc-cygwin/ports/libxslt/1.1.34/libxslt-1.1.34' から出ます 88make: *** [Makefile:441: all] エラー 2 89======================================================================== 90*** extconf.rb failed *** 91Could not create Makefile due to some reason, probably lack of necessary 92libraries and/or headers. Check the mkmf.log file for more details. You may 93need configuration options. 94 95Provided configuration options: 96 --with-opt-dir 97 --without-opt-dir 98 --with-opt-include 99 --without-opt-include=${opt-dir}/include 100 --with-opt-lib 101 --without-opt-lib=${opt-dir}/lib 102 --with-make-prog 103 --without-make-prog 104 --srcdir=. 105 --curdir 106 --ruby=/home/1/.rbenv/versions/2.7.1/bin/$(RUBY_BASE_NAME) 107 --help 108 --clean 109 --use-system-libraries 110 --enable-static 111 --disable-static 112 --with-zlib-dir 113 --without-zlib-dir 114 --with-zlib-include 115 --without-zlib-include=${zlib-dir}/include 116 --with-zlib-lib 117 --without-zlib-lib=${zlib-dir}/lib 118 --enable-cross-build 119 --disable-cross-build 120/home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:402:in `block in execute': Failed to complete compile task (RuntimeError) 121 from /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `chdir' 122 from /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `execute' 123 from /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:115:in `compile' 124 from /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:154:in `cook' 125 from extconf.rb:365:in `block (2 levels) in process_recipe' 126 from extconf.rb:257:in `block in chdir_for_build' 127 from extconf.rb:256:in `chdir' 128 from extconf.rb:256:in `chdir_for_build' 129 from extconf.rb:364:in `block in process_recipe' 130 from extconf.rb:262:in `tap' 131 from extconf.rb:262:in `process_recipe' 132 from extconf.rb:574:in `<main>' 133 134To see why this extension failed to compile, please check the mkmf.log which can be found here: 135 136 /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-cygwin/2.7.0/nokogiri-1.10.10/mkmf.log 137 138extconf failed, exit code 1 139 140Gem files will remain installed in /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10 for inspection. 141Results logged to /home/1/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-cygwin/2.7.0/nokogiri-1.10.10/gem_make.out 142

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

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

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

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

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

otn

2020/09/12 04:56

エラーメッセージの通りリンクのエラーなので、libxslt のインストールがうまく行ってないか? あと、Rubyはcygwinでビルトされた物なんでしょうか?
d04062

2020/09/12 05:48 編集

ビルドの理解が間違っているかもしれないのですが、 git clone git://github.com/sstephenson/rbenv.git ~/.rbenvでrbenv を入れた後、 rbenv install 2.7.1 を行っています (通常のMac・LinuxのRubyのインストールと同じということです)
guest

回答2

0

自己解決

自己解決しました。
おそらくnokogiriとpublic_suffixのインストールにオプションの設定が必要なようです。

gem install public_suffix -v '4.0.5' --source 'https://rubygems.org/' gem install nokogiri -- --use-system-libraries --with-xml2-config=/path/to/xml2-config gem install nokogiri -- --use-system-libraries --with-xslt-config=/path/to/xslt-config

投稿2020/09/12 06:26

d04062

総合スコア111

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

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

0

補足です。

gem install google_driveではなく、
Gemfileへの記載に変更したところ、、

gem 'google_drive' $bundle install Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... Fetching public_suffix 4.0.5 Installing public_suffix 4.0.5 Gem::Package::PathError: installing into parent path .github/FUNDING.yml of /cygdrive/z/Share_Link/selenium/cf/vendor/bundle/ruby/2.7.0/gems/public_suffix-4.0.5 is not allowed An error occurred while installing public_suffix (4.0.5), and Bundler cannot continue. Make sure that `gem install public_suffix -v '4.0.5' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: google_drive was resolved to 3.0.5, which depends on google-api-client was resolved to 0.32.1, which depends on googleauth was resolved to 0.9.0, which depends on signet was resolved to 0.11.0, which depends on addressable was resolved to 2.7.0, which depends on public_suffix となり、 $gem install public_suffix -v '4.0.5' --source 'https://rubygems.org/' 1 gem installed その後再度、 $bundle install Fetching gem metadata from https://rubygems.org/....... Resolving dependencies... Fetching public_suffix 4.0.5 Installing public_suffix 4.0.5 Gem::Package::PathError: installing into parent path .github/FUNDING.yml of /cygdrive/z/Share_Link/selenium/cf/vendor/bundle/ruby/2.7.0/gems/public_suffix-4.0.5 is not allowed An error occurred while installing public_suffix (4.0.5), and Bundler cannot continue. Make sure that `gem install public_suffix -v '4.0.5' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: google_drive was resolved to 3.0.5, which depends on google-api-client was resolved to 0.32.1, which depends on googleauth was resolved to 0.9.0, which depends on signet was resolved to 0.11.0, which depends on addressable was resolved to 2.7.0, which depends on public_suffix 同じエラーが出たままでした。

投稿2020/09/12 03:23

d04062

総合スコア111

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問