スポンサーサイト
Hpricot をインストールしようとしてエラー
環境: CentOS 5.3 / Ruby 1.8.5 (RPM)
再度インストール。
# gem install hpricot
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install hpricot
can't find header files for ruby.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.1/ext/hpricot_scan/gem_make.out
Ruby のヘッダファイルが無いのが原因らしい。
Ruby の RPM パッケージでは、ヘッダファイルは ruby-devel-*.rpm に
入ってるらしいのでインストールする。
# yum install ruby-devel
再度インストール。
# gem install hpricot
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install hpricot
checking for main() in -lc... yes
creating Makefile
make
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -fPIC -c hpricot_css.c
hpricot_css.rl: In function ‘hpricot_css’:
hpricot_css.rl:106: warning: implicit declaration of function ‘RSTRING_PTR’
hpricot_css.rl:106: warning: assignment makes pointer from integer without a cast
hpricot_css.rl:107: warning: implicit declaration of function ‘RSTRING_LEN’
hpricot_css.c:3399: warning: comparison between pointer and integer
hpricot_css.c:3399: warning: ‘eof’ is used uninitialized in this function
hpricot_css.rl:92: warning: ‘aps’ may be used uninitialized in this function
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -fPIC -c hpricot_scan.c
hpricot_scan.rl: In function ‘our_rb_hash_lookup’:
hpricot_scan.rl:169: warning: implicit declaration of function ‘st_lookup’
hpricot_scan.rl: In function ‘make_hpricot_struct’:
hpricot_scan.rl:693: warning: implicit declaration of function ‘RARRAY_PTR’
hpricot_scan.rl:693: error: subscripted value is neither array nor pointer
make: *** [hpricot_scan.o] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/hpricot-0.8.1/ext/hpricot_scan/gem_make.out
hpricot_scan.c を見てみたけど、どうも正常にコンパイルできる様に見えない。
必要なマクロがどこにも見つからない。
たぶんこれは Ruby 1.8.6 以降じゃないと動かないんじゃないか?
という事で、良く分らないけど古いバージョンをインストールしてみる。
# gem install hpricot --version 0.7 Building native extensions. This could take a while... Successfully installed hpricot-0.7 1 gem installed Installing ri documentation for hpricot-0.7... Installing RDoc documentation for hpricot-0.7...インストールできたので、とりあえずこれで使ってみる。
コメント
コメントの投稿
トラックバック
http://snbhsmt.blog110.fc2.com/tb.php/111-47f9f67e

