在 ruby-1.8.7-p334 [ x86_64 ] 上使用 rvm 安装 nokogiri gem 时出错
当我尝试在 Mac OS X 10.6 上的 ruby-1.8.7-p334 [ x86_64 ]
上安装 nokogiri
gem 时,出现以下错误:
sudo gem install nokogiri
/Users/patelc75/.rvm/rubies/ruby-1.8.7-p334/bin/gem:4: warning: Insecure world writable dir /Users in PATH, mode 040777
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/patelc75/.rvm/rubies/ruby-1.8.7-p334/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv 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.
When I try to install nokogiri
gem on ruby-1.8.7-p334 [ x86_64 ]
on Mac OS X 10.6, I get the following error:
sudo gem install nokogiri
/Users/patelc75/.rvm/rubies/ruby-1.8.7-p334/bin/gem:4: warning: Insecure world writable dir /Users in PATH, mode 040777
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/patelc75/.rvm/rubies/ruby-1.8.7-p334/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在安装 nokogiri gem 之前,您需要安装库。
执行此操作的步骤
以下是使用自制程序和 macports
更多信息请参见http://nokogiri.org/tutorials/installing_nokogiri .html
Before installing nokogiri gem, you need to get libraries installed.
Here are the steps to do it with homebrew
With macports
More information here http://nokogiri.org/tutorials/installing_nokogiri.html
我尝试了我能找到的各种解决方案,包括:
。使用brew安装libxslt / libxml2 / libiconv
。尝试使用各种 --with-configurations 进行 gem 安装
遗憾的是,它们都不适用于我,直到我卸载了 MacPort 和所有已安装的端口。
然后只需执行命令 gem install nokogiri,gem 和 rdoc 就轻松安装了。
我不明白为什么的细节,但根据我自己使用MacPort的经验(导致安装了多套ruby/rake/gem)以及比较brew和port的文章,我不会再回到port 。
I tries all kinds of solutions I can found, including:
. use brew to install libxslt / libxml2 / libiconv
. tries to gem install with various --with-configurations
sadly, they all didn't work for me, until I uninstalled MacPort and all installed ports.
Then simply executed command gem install nokogiri, the gem and rdoc got installed like a breeze.
I don't understand the very details of why, but according to my own experiences of using MacPort (resulted in multiple sets of ruby/rake/gem(s) installed) and articles comparing brew and port, I will not go back to port.