Error - “gem install rails” - libxml2 is missing

后端 未结 8 1761
滥情空心
滥情空心 2021-01-05 02:14

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 instal

8条回答
  •  孤城傲影
    2021-01-05 03:03

    It worked for me as Simar has mentioned.

    sudo gem install rails -- --use-system-libraries --with-xml=/usr/local/Cellar/libxml2/
    

    And if you were having troubles install it on Mac please check out here. https://gorails.com/setup/osx/10.11-el-capitan

    Also if you could not find /usr/local/Cellar/libxml2/ existing, you may need to homebrew it.

    brew install libxml2
    

    If you are installing it on a newly installed OS X EL CAPITAN as I do, you probably find homebrew telling you that libxml2 is installed already and brew will not replace the existing libxml2 with it's newly installed one which is at /usr/local/Cellar/libxml2/, which is the one we really should link the libraries to. Since the system default libxml2 would not link successfully.

提交回复
热议问题