gpt4 book ai didi

ruby-on-rails - 在 ruby​​-1.8.7-p334 [ x86_64 ] 上使用 rvm 安装 nokogiri gem 时出错

转载 作者:行者123 更新时间:2023-12-04 06:16:12 25 4
gpt4 key购买 nike

当我尝试安装 nokogiri gem 上 ruby-1.8.7-p334 [ x86_64 ]在 Mac OS X 10.6 上,我收到以下错误:

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.

最佳答案

在安装 nokogiri gem 之前,您需要安装库。
以下是使用自制软件执行此操作的步骤

# the rest of this snippet assumes installation of libxml 2.7.7. YMMV.
brew install libxml2
brew link libxml2

# install libxslt from source
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar -zxvf libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 \
--with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7
make
sudo make install

gem install nokogiri -- --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26

使用 macports
sudo port install libxml2 libxslt
sudo gem install nokogiri

更多信息在这里 http://nokogiri.org/tutorials/installing_nokogiri.html

关于ruby-on-rails - 在 ruby​​-1.8.7-p334 [ x86_64 ] 上使用 rvm 安装 nokogiri gem 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7209965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com