[Rails][CentOS]gemのnokogiriインストールでエラー ERROR: Error installing nokogiri:
はじめに
bundle installでgemのnokogiriがinstallできていませんとエラーがでました。
直接nokogiriをinstall指定していませんでした。※これはインストールするgem内でnokogiriを使っているgemがあったのかと思います。
その後、nokogiriをyumでインストールしましたがエラーが出たため、対応策をメモしておきます。
エラーの改善について
詳細エラー内容
インストール実行
$ sudo yum install nokogiri
エラー内容
Building native extensions. This could take a while…
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension./home/vagrant/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20150506-10401-826g5c.rb extconf.rb
checking if the C compiler accepts … yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz… yes
checking for iconv… yes
************************************************************************
IMPORTANT NOTICE:Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
– 0001-Revert-Missing-initialization-for-the-catalog-module.patch
– 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patchTeam 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 installNote, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2… OK
Running patch with /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch…
Running ‘patch’ for libxml2 2.9.2… ERROR, review ‘/home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/patch.log’ to see what happened.
*** 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=/home/vagrant/.rbenv/versions/2.2.1/bin/$(RUBY_BASE_NAME)
–help
–clean
–use-system-libraries
–enable-static
–disable-static
–with-zlib-dir
–without-zlib-dir
–with-zlib-include
–without-zlib-include=${zlib-dir}/include
–with-zlib-lib
–without-zlib-lib=${zlib-dir}/lib
–enable-cross-build
–disable-cross-build
/home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:279:in `block in execute’: Failed to complete patch task (RuntimeError)
from /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `chdir’
from /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:271:in `execute’
from extconf.rb:311:in `block in patch’
from extconf.rb:308:in `each’
from extconf.rb:308:in `patch’
from /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mini_portile-0.6.2/lib/mini_portile.rb:108:in `cook’
from extconf.rb:278:in `block in process_recipe’
from extconf.rb:177:in `tap’
from extconf.rb:177:in `process_recipe’
from extconf.rb:475:in `‘ extconf failed, exit code 1
Gem files will remain installed in /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /home/vagrant/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/nokogiri-1.6.6.2/gem_make.out
対応策
エラー内に改善案が書いてありました。
必要なライブラリをインストールし再度nokogiriを指定方法によりインストールします。これで手元環境ではエラーなく成功しました。
$ sudo yum -y install libxml2 libxslt libxml2-devel libxslt-devel $ gem install nokogiri -- --use-system-libraries
その他おすすめの備忘録
- [CentOS][Ruby][Rails]最新・安定版のRuby2.2.1(rbenv) / Rails4.1.1環境を構築する
- [Rails]MacにRails開発環境を構築(インストール)する
- [Ruby][Mac]The Ruby openssl extension was not compiled. Missing the OpenSSL lib?エラー
- [Rails][Ruby]エラー:Warning: You’re using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine –all` for better startup performance.
- [Ruby]エラー:Inspect or clean up the working tree at /tmp/ruby-build・・・
- [Rails][CentOS]rails server起動しページ表示で『ExecJS::RuntimeUnavailable in ・・・』エラーの改善
- [CentOS]nginxのインストールから起動まで
- [CentOS]外部リポジトリのパッケージ管理を導入する方法(最新版パッケージがインストールできる)
- [CentOS]mysqlをインストールしrootパスワードなど初期設定をする
- [Vagrant + Chef]CentOSにPHP + MYSQL + APACHE 環境を構築する
coffee-break
Don't write code that useless.
1日5杯はコーヒー、カフェオレ飲みます。狭心症のため安静にします☆松本 雄貴
Kotlinでサービスリリース目指す!
iOSでチャットアプリ作成中。自然言語解析LSIを習得中
Mac / Android・iOS / Rails / Oracle
2017年 Lpic L2取得
2012年 Android技術者資格取得
2010年 OracleMasterGold10g取得
2008年 CCNAQiitaもたまに投稿
https://qiita.com/y-matsumoto東京近郊で常駐開発探してる方はこちらよりご連絡ください
SES企業でパートナー会社を探している企業様はこちらよりご連絡ください
スプリットカメラ iOS / Android
音声認識で聞いた日付から曜日当てアプリ Android
ソーシャルタイマー Android
カテゴリー
- ActiveRecord (2)
- Android (52)
- AndroidStudio (10)
- Ansible (1)
- AWS (1)
- Bash (18)
- Blog (7)
- BootStrap (1)
- CentOS (16)
- Chef (1)
- css (2)
- Eclipse (5)
- error (1)
- Facebook (2)
- Firebase (1)
- FuelPHP (16)
- Git (22)
- GitHub (3)
- Gradle (2)
- GraphAPI (1)
- Grunt (1)
- heroku (2)
- illustrator (1)
- iOS (17)
- Java (4)
- Jenkins (1)
- jQuery (3)
- Kotlin (2)
- Mac (22)
- nginx (1)
- Node.js (3)
- peco (1)
- php (5)
- Python (1)
- Rails (16)
- Ruby (11)
- shell (1)
- SNS (1)
- Swift (2)
- tmux (2)
- Vagrant (6)
- Vim (6)
- windows (2)
- WordPress (3)
- zsh (4)
- フリーランス (1)
- ライブラリ (1)
- 勉強会 (2)
- 宣伝 (1)
- 未分類 (2)
最近の投稿
- [MAC]HighSierraでgitプッシュエラー「Unable to negotiate with xxx.xxx.xxx.xxx port xx: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se fatal: Could not read from remote repository.」
- [iOS]iOS11からFacebook,Twitter連携(シェアなど)廃止の対応方法
- [iOS]速報2017AppleSpecialEventのiOS11、iPhone8など発表内容について
- [iOS][Firebase]The default Firebase app has not yet been configured. Add `[FIRApp configure];
- [iOS]2017年9月リリースのiOS11で開発者が対応するべきこと
- 今人気の現金化サービスCASH(キャッシュ)を使ったレビュー
- [Pandoc][Mac]pandocでmarkdownからwordファイル作成
- [Android]映画サマーウォーズの聞いた日付(誕生日)から曜日当てをアプリ音声認識で簡単に実現
- [Android]起動しているActivityを取得するadb shell コマンド
- [Android][Kotlin]kotlin学習で参考になるサイト一覧
2023年5月 月 火 水 木 金 土 日 « 5月 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 アーカイブ
- 2018年5月
- 2017年9月
- 2017年8月
- 2017年7月
- 2017年6月
- 2017年5月
- 2017年2月
- 2017年1月
- 2016年12月
- 2016年7月
- 2016年6月
- 2016年1月
- 2015年12月
- 2015年11月
- 2015年10月
- 2015年9月
- 2015年8月
- 2015年7月
- 2015年6月
- 2015年5月
- 2015年4月
- 2015年3月
- 2015年2月
- 2015年1月
- 2014年12月
- 2014年11月
- 2014年6月
- 2014年5月
- 2014年4月
- 2014年3月
- 2014年2月
- 2014年1月
- 2013年12月
- 2013年11月
- 2013年9月
- 2013年8月
- 2013年7月
- 2013年6月
- 2013年5月
- 2013年4月
- 2013年3月
- 2013年2月
- 2013年1月
- 2012年12月
- 2012年10月
- 2012年5月
- 2010年6月
おすすめ備忘録
- [CentOS][Ruby][Rails]最新・安定版のRuby2.2.1(rbenv) / Rails4.1.1環境を構築する
- [Rails]MacにRails開発環境を構築(インストール)する
- [Ruby][Mac]The Ruby openssl extension was not compiled. Missing the OpenSSL lib?エラー
- [Rails][Ruby]エラー:Warning: You’re using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine –all` for better startup performance.
- [Ruby]エラー:Inspect or clean up the working tree at /tmp/ruby-build・・・
エントリ