我一直在尝试在我的计算机上安装Rails,但我似乎无法弄明白。使用后
gem install rails
我遇到了许多我无法解读的错误。他们似乎与Nokogiri有关,但经过3-4个小时看似随意的安装和“修复”,我无处可去。
我尝试使用
gem install nokogiri -v 1.6.5 -- --use-system-libraries
得到了
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/xlforloser/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150103-18446-1ac5ew1.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in- future... no
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
如果我只运行gem install rails
,我就会
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
Running 'compile' for libxml2 2.9.2... ERROR, review '/Users/xlforloser/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.5/ext/nokogiri/tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.9.2/compile.log' to see what happened.
请帮忙!
答案 0 :(得分:1)
您有两个关于此问题的提示:
libxml2 version 2.6.21 or later is required!
...review '/Users/xlforloser/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.5/ext/nokogiri/tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.9.2/compile.log' to see what happened.
解决这些问题:
答案 1 :(得分:1)
我遇到了同样的错误并遇到了这个类似的帖子,帮助我解决了Yosemite的问题(还有一个Maverick的修复):