Nokogiri 1.6.1不会安装在Mavericks / Rails 1.9.3上

时间:2014-02-15 14:56:19

标签: ruby-on-rails ruby ruby-on-rails-3 nokogiri

我是setup / config的新手,但以前在我的Mac(Mavericks)上安装并运行了旧版(1.8.7)/更新版(2.0版)的Ruby和Rails,但我正在处理别人的代码需要1.9.3 / 3.2并且在过去的三天里试图让它工作无济于事。我已经安装了Ruby 1.9.3p429,但当我rails -v时,它说:

  

无法在任何来源中找到nokogiri-1.6.1运行bundle install以安装缺少的宝石。

所以我试过了,我在gem_make.out中遇到以下错误:

> /Users/sa/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
> /Users/sa/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/yaml.rb:56:in
> `<top (required)>': It seems your ruby installation is missing psych
> (for YAML output). To eliminate this warning, please install libyaml
> and reinstall your ruby. Extracting libxml2-2.8.0.tar.gz into
> tmp//ports/libxml2/2.8.0... OK Running 'configure' for libxml2
> 2.8.0... ERROR, review 'tmp//ports/libxml2/2.8.0/configure.log' to see what happened.
> *** 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  --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/sa/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
> /Users/sa/.rvm/gems/ruby-1.9.3-p429/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in
> `block in execute': Failed to complete configure task (RuntimeError)
>   from
> /Users/sa/.rvm/gems/ruby-1.9.3-p429/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in
> `chdir'   from
> /Users/sa/.rvm/gems/ruby-1.9.3-p429/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in
> `execute'     from
> /Users/sa/.rvm/gems/ruby-1.9.3-p429/gems/mini_portile-0.5.2/lib/mini_portile.rb:65:in
> `configure'   from
> /Users/sa/.rvm/gems/ruby-1.9.3-p429/gems/mini_portile-0.5.2/lib/mini_portile.rb:108:in
> `cook'    from extconf.rb:101:in `block in <main>'    from
> extconf.rb:119:in `call'  from extconf.rb:119:in `block in <main>'
>   from extconf.rb:109:in `tap'    from extconf.rb:109:in `<main>'
> 
> extconf failed, exit code 1

我尝试过的步骤没有成功,包括:

  • 阅读/尝试SO和Github上的所有内容
  • 卸载/重新安装brew和RVM
  • 安装了XCode命令行工具
  • 链接libxml2和libxslt等

Bashrc包含:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export CC=/usr/local/bin/gcc-4.2
export CPP=/usr/local/bin/cpp-4.2
export CXX=/usr/local/bin/g++-4.2
#export CC=/usr/local/bin/gcc-4.9
#export CPP=/usr/local/bin/cpp-4.9
#export CXX=/usr/local/bin/g++-4.9

我不知道接下来要做什么。非常感谢任何和所有的帮助。

1 个答案:

答案 0 :(得分:0)

我有类似的问题,但能够使用此命令成功运行

ruby -v ; gem i -i xxx nokogiri -v '1.6.2.1'