错误-"gem安装导轨" -缺少libxml2 [英] Error - "gem install rails" - libxml2 is missing
问题描述
我一直在按照Rails的安装说明进行操作( http://railsapps.github.io /installrubyonrails-mac.html ),一切正常,直到我进入 New Rails Application 下的gem install rails
部分.当我运行时,我得到的libxml2丢失了.这是日志: http://codecascade.com/sIjhQ/raw
I've been working through the Rails install instructions (http://railsapps.github.io/installrubyonrails-mac.html) and everything was okay up until I got to gem install rails
part under New Rails Application. When I ran that I got libxml2 is missing. Here's the log: http://codecascade.com/sIjhQ/raw
我在安装nokogiri时遇到了类似的问题,而解决该问题的唯一方法是使用
I had similar issues install nokogiri, and the only way I was able to get it resolved was with
gem install nokogiri -- --use-system-libraries
我在OS X 10.10.2上.如果有可能,我还安装了RubyMine.
I'm on OS X 10.10.2. I also have RubyMine installed if that's potentially relevant.
推荐答案
我只是遇到了同样的问题,并且能够按以下步骤解决它:
I just had the same problem and was able to solve it as follows:
仅当使用系统库时,才能单独安装Nokogiri:
Installing Nokogiri separately worked only when using the system libraries:
gem install nokogiri -- --use-system-libraries
...但是执行bundle install
时仍然失败.因此,只需将bundler配置为也使用系统库来构建Nokogiri:
...but was still failing when executing bundle install
. So just configure bundler to also build Nokogiri using the system libraries:
bundle config build.nokogiri --use-system-libraries
这篇关于错误-"gem安装导轨" -缺少libxml2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!