Installing the Mechanize Gem in ubuntu

jeff@ubuntu:/$ sudo gem install mechanize
[sudo] password for jeff:
Building native extensions.  This could take a while...
ERROR:  Error installing mechanize:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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=/usr/bin/ruby1.8
    --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-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-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-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib


Gem files will remain installed in /var/lib/gems/1.8/gems/nokogiri-1.4.3.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/nokogiri-1.4.3.1/ext/nokogiri/gem_make.out


解决方法:

 

 

1)jeff@ubuntu:/$ sudo apt-get install libxslt1-dev

 

正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
下列【新】软件包将被安装:
  libxslt1-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 619kB 的软件包。
解压缩后会消耗掉 2,544kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick/main libxslt1-dev i386 1.1.26-6 [619kB]
下载 619kB,耗时 12秒 (48.1kB/s)                                              
选中了曾被取消选择的软件包 libxslt1-dev。
(正在读取数据库 ... 系统当前共安装有 139015 个文件和目录。)
正在解压缩 libxslt1-dev (从 .../libxslt1-dev_1.1.26-6_i386.deb) ...
正在处理用于 doc-base 的触发器...
Processing 1 added doc-base file(s)...
Registering documents with scrollkeeper...
正在处理用于 man-db 的触发器...
正在设置 libxslt1-dev (1.1.26-6) ...

 

2)jeff@ubuntu:/$ sudo gem install mechanize

 

Building native extensions.  This could take a while...
Successfully installed nokogiri-1.4.3.1
Successfully installed mechanize-1.0.0
2 gems installed
Installing ri documentation for nokogiri-1.4.3.1...

No definition for parse_memory

No definition for parse_file

No definition for parse_with

No definition for get_options

No definition for set_options
Installing ri documentation for mechanize-1.0.0...
Installing RDoc documentation for nokogiri-1.4.3.1...

No definition for parse_memory

No definition for parse_file

No definition for parse_with

No definition for get_options

No definition for set_options
Installing RDoc documentation for mechanize-1.0.0...

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值