2009-03-29
hpricotじゃなくてnokogiri
あたらしい鯖にmechanizeをインストールしようとしたら躓いたのでメモ
[root@localhost rubygems-1.3.1]# gem install mechanize
Building native extensions. This could take a while...
ERROR: Error installing mechanize:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install mechanize
checking for iconv.h in /usr/local/include,/opt/local/include,/usr/local/include,/usr/include... yes
checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include/libxml2... no
libxml2 is missing. try 'port install libxml2' or 'yum install libxml2'
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
・・・省略
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.2.3 for inspection.
libxml2を入れてくれ?おにぎり?あ、のこぎりか。
yum install libxml2
・・・
Package libxml2 - 2.6.26-2.1.2.7.i386 is already installed.
ん?既にはいってるって。
yum install libxml2-devel
んーーnokogiriをパーサとして使うらしいのでgem
[root@localhost bin]# gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install nokogiri
checking for iconv.h in /usr/local/include,/opt/local/include,/usr/local/include,/usr/include... yes
checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include/libxml2... no
libxslt is missing. try 'port install libxslt' or 'yum install libxslt-devel'
extconf.rb failed ***
なんですと?こんどはlibxslt-develが必要?
[root@localhost bin]# yum install libxslt-devel
・・・省略
[root@localhost bin]# gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.2.3
1 gem installed
Installing ri documentation for nokogiri-1.2.3...
Installing RDoc documentation for nokogiri-1.2.3...
でmechanizeは0.9からおにぎり・・じゃなかったノコギリらしいがコレでOK
[root@localhost bin]# gem install mechanize
Successfully installed mechanize-0.9.2
1 gem installed
Installing ri documentation for mechanize-0.9.2...
Installing RDoc documentation for mechanize-0.9.2...
- 2 http://hatx.blog.so-net.ne.jp/2008-02-13
- 2 http://k.hatena.ne.jp/keywordblog/yum
- 2 http://www.google.co.jp/search?hl=ja&q=yum+エラー&btnG=検索&lr=
- 1 http://72.14.235.132/search?q=cache:OTHK1Jk5ofQJ:d.hatena.ne.jp/astrsk_heta/20081125/1227613626+netbeans6.5+拡張子 登録&cd=1&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a
- 1 http://d.hatena.ne.jp/koseki2/20081030/mocksmtpd
- 1 http://k.hatena.ne.jp/keywordblog/RubyGems
- 1 http://reader.livedoor.com/reader/
- 1 http://search.yahoo.co.jp/search?p=OSx+英数全角入力+&ei=UTF-8&fr=top_ga1_sa&x=wrt
- 1 http://www.google.co.jp/ig?hl=ja&t=7
- 1 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:ja-JP-mac:official&hs=LXn&q=mac+カーソル&btnG=検索&lr=lang_ja
