- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我试图在我的 Rails 应用程序上进行捆绑安装,但它卡在了“正在安装 nokogiri”处。错误消息底部的说明说
Make sure that `gem install nokogiri -v '1.5.5'` succeeds before bundling.
当我看到它时,我尝试了
gem install nokogiri -v '1.5.5'
它告诉我安装 Nokogiri 时出错。我在 Mac 上的 Rails 3.0.4 应用程序中使用 Ruby 1.9.2。
任何人都可以提出修复建议吗?
Installing nokogiri (1.5.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/mm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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=/Users/mm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--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
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-libiconv-config
--without-libiconv-config
--with-pkg-config
--without-pkg-config
/Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:114:in `<main>'
Gem files will remain installed in /Users/mm/.rvm/gems/ruby-1.9.2-p290@rails304/gems/nokogiri-1.5.5 for inspection.
Results logged to /Users/mm/.rvm/gems/ruby-1.9.2-p290@rails304/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.5.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.5'` succeeds before bundling.
brew doctor
说没有问题。 brew update
表示所有内容都已更新。当我执行 brew install libxslt libxml2 libiconv
时,出现此错误:
Error: No available formula for libiconv
Apple distributes libiconv with OS X, you can find it in /usr/lib.
Some build scripts fail to detect it correctly, please check existing
formulae for solutions.
当我尝试执行 gem install nokogiri
时出现此错误:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/mm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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=/Users/mm/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--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
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-libiconv-config
--without-libiconv-config
/Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/mm/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:115:in `<main>'
最佳答案
假设您还没有安装 Homebrew:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
brew doctor
确保一切正常
brew update
为了能够安装libiconv
brew tap homebrew/dupes
brew install libxslt libxml2 libiconv
brew link libxslt libxml2 libiconv
gem install nokogiri
关于ruby - 捆绑安装在 Nokogiri 停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14109450/
我在 OSX 上使用 RVM 和之前的 RBENV。我在 ./gems 中相对于我的项目路径安装了我的 gems 我正在使用 aws-sdk 并尝试使用 s3 客户端导致 nokogiri/nokog
我正在尝试使用以下版本在 Mac OS Big Sur 上构建 Rails 应用程序...... $ rails --version Rails 5.0.7.2 $ ruby --version ru
我正在尝试抓取 http://www.ign.com/games/reviews使用 Nokogiri,我想实例化与页面上每个游戏评论相对应的新评论对象。当然,我还想从每条评论中获取每个数字分数,并将
我正在编写 Lynda 的 Ruby on Rails 教程,一切都按预期进行。所有安装和一切都运行完美。 但是创建项目后,当我尝试启动服务器(cmd:rails server)时,我收到错误消息:
尝试按如下方式在生产模式下运行 rake Assets 预编译。 rake assets:precompile 它在 ubuntu 14.04(32 位)和 16.06(32 位)上运行良好。但是在
我需要一种方法来运行 nokogiri 脚本 #parser.rb require 'nokogiri' def parseit() //... end 并在 jruby 的 main.rb 下面运行
在解析缩进的 XML 时,不重要的空白文本节点是从结束标记和开始标记之间的空白创建的。例如,来自以下 XML: Tove Jani Reminder Don't forget me
Nokogiri 在我的 gem 文件中。 bundle 安装返回预期的输出: Using nokogiri (1.4.4) Your bundle is complete! Use `bundle
我安装了 Ruby 和 Nokogiri gem。在 irb 中,我尝试: require 'nokogiri' require 'open-uri' url = 'http://www.amazon
我想使用 XSL 将 XML 文档转换为 HTML,稍微修改一下,然后将其呈现出来。这基本上就是我正在做的: source = Nokogiri::XML(File.read 'source.xml'
我的 Ruby on Rails 应用程序使用 Rails 2.2.2 和 Ruby 1.8.7。 尝试运行时 RAILS_ENV=production rake gems:install 或任何佣金
在 IRB 中,当我键入 require“nokogiri”时,出现以下错误: LoadError: cannot load such file -- nokogiri 我的 gemfile 中安装了
我正在使用 DevKit 在 Windows 8.1 上运行全新安装的 Ruby 2.2.1。安装后我运行: gem install rails rails new testapp cd testap
我正在尝试安装 nokogiri,因为它是启动 rails 所必需的 $ rails s /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bun
我终于设法解析了网站的部分内容: get '/' do url = '' data = Nokogiri::HTML(open(url)) @rows = data.css("td[val
我第一次使用 Nokogiri 搜索 HTML 文档。当我创建一个变量(并打印)时,它等于: beteween Nokogiri::HTML(open(url).read) 它似乎输出与完全相同的东西
如果我尝试安装 nokogiri,我会收到以下错误: rvmsudo gem install nokogiri ERROR: Error installing nokogiri: nokog
我在屏幕抓取 rake 任务中有以下代码 page = agent.get("https://domainname.co.uk/unit/27/logs?type=incoming&page=8")
我尝试(出于测试目的)解析 Google 商家 XML 提要,定义为: EasyOptic 2014-08-01T16:31:
如何将“foo”替换为“bar”? 来自 foo1foo2foo4foo5foo6 至 bar1bar2bar4bar5bar6 我只想替换标签内部内容,没有标签属性。 有什么想法吗? 最佳答案 re
我是一名优秀的程序员,十分优秀!