【发布时间】:2014-07-21 10:04:39
【问题描述】:
我尝试了几个小时(现在是几天...)来安装 Nokogiri 1.6.3 我以为我可以在 Nokogiri 网站 (http://nokogiri.org/tutorialsinstalling_nokogiri.html) 上进行说明,但它失败了,需要安装开发工具...
/Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/yves/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
我使用的是 XCode 5.1,并且安装了开发工具!否则我无法安装 libiconv 库...
yves$ ./configure --prefix=/usr/local/Cellar/libiconv/1.14
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
yves$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
我浏览了与此问题相关的所有问题/答案(许多案例,许多给定的解决方案;..),但没有一个适用于 Nokogiri 1.6.3(最新更新)
只是为了反查,我尝试安装 gem ffi,它还需要构建原生扩展,这很好......
yves$ gem install ffi
Fetching: ffi-1.9.3.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.3
1 gem installed
【问题讨论】:
-
似乎绝对是 Nokogiri 1.6.3 gem 安装问题...我终于安装了 1.6.2.1 wo 任何麻烦并锁定它...。
标签: ruby-on-rails nokogiri osx-mavericks rbenv