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

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

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

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

2回答

3307閲覧

nokogiriエラー。。。

rowarubchinsky

総合スコア20

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

1クリップ

投稿2018/10/25 04:22

編集2018/10/25 04:27

bundle installをして開発をしていた時には、何もなかったのですが、

本番環境にあげようと思い、いざbundle install --path vendor/bundler

をするとノコギリでエラーが起きてしまします。

中略 Installing nokogiri 1.8.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/itou_ooji/re_japan_test/jp/j_p_10_16/vendor/bundler/ruby/2.5.0/gems/nokogiri-1.8.5/ext/nokogiri /Users/itou_ooji/.rbenv/versions/2.5.0/bin/ruby -r ./siteconf20181025-18377-dn81v7.rb extconf.rb --use-system-libraries checking if the C compiler accepts ... yes checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no Building nokogiri using system libraries. pkg-config could not be used to find libxml-2.0 Please install either `pkg-config` or the pkg-config gem per gem install pkg-config -v "~> 1.1" pkg-config could not be used to find libxslt Please install either `pkg-config` or the pkg-config gem per gem install pkg-config -v "~> 1.1" pkg-config could not be used to find libexslt Please install either `pkg-config` or the pkg-config gem per gem install pkg-config -v "~> 1.1" ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. *** 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: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/itou_ooji/.rbenv/versions/2.5.0/bin/$(RUBY_BASE_NAME) --help --clean --use-system-libraries --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-libxml-2.0-config --without-libxml-2.0-config --with-pkg-config --without-pkg-config --with-xslt-dir --without-xslt-dir --with-xslt-include --without-xslt-include=${xslt-dir}/include --with-xslt-lib --without-xslt-lib=${xslt-dir}/lib --with-libxslt-config --without-libxslt-config --with-exslt-dir --without-exslt-dir --with-exslt-include --without-exslt-include=${exslt-dir}/include --with-exslt-lib --without-exslt-lib=${exslt-dir}/lib --with-libexslt-config --without-libexslt-config To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/itou_ooji/re_japan_test/jp/j_p_10_16/vendor/bundler/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nokogiri-1.8.5/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/itou_ooji/re_japan_test/jp/j_p_10_16/vendor/bundler/ruby/2.5.0/gems/nokogiri-1.8.5 for inspection. Results logged to /Users/itou_ooji/re_japan_test/jp/j_p_10_16/vendor/bundler/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nokogiri-1.8.5/gem_make.out An error occurred while installing nokogiri (1.8.5), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.8.5' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails was resolved to 5.2.1, which depends on actioncable was resolved to 5.2.1, which depends on actionpack was resolved to 5.2.1, which depends on actionview was resolved to 5.2.1, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri

これを解決したいのですが、何をすればいいのでしょうか。
自分自身原因が全くわからないです。。。

エラー文に書かれていたgem install nokogiri -v '1.8.5' --source 'https://rubygems.org/'は通したのですが、それでもまだエラーが起きます。。

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

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

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

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

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

guest

回答2

0

ベストアンサー

お使いの環境がよくわからないので、具体的な指摘はできませんが...

pkg-config could not be used to find libxml-2.0

Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libxslt
Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libexslt
Please install either pkg-config or the pkg-config gem per

gem install pkg-config -v "~> 1.1"

ERROR: cannot discover where libxml2 is located on your system. please make sure pkg-config is installed.

といわれています。

pkg-config や libxml-2.0 や libxslt や libexslt が、見つからないようですが、インストールされていますか?

投稿2018/10/25 04:57

CHERRY

総合スコア25171

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

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

0

https://github.com/SlatherOrg/slather/issues/227#issuecomment-243725696

こちらと同じみたいですがいかがでしょうか

投稿2018/10/25 04:47

yeondev

総合スコア198

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問