Bundle install fails to install libxml-ruby

前端 未结 4 2255
礼貌的吻别
礼貌的吻别 2021-02-20 09:50

I\'m a new to Ruby world and I need to clone an existing project.

The instructions are:

source .env.development
bundle install

But it f

相关标签:
4条回答
  • I manage to fix this with the help of a colleague, if anybody else encounter this problem:

    gem install libxml-ruby -v '2.9.0' -- --use-system-libraries --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.8/include/libxml2/libxml/ --with-xml2-config=/usr/bin/xml2-config
    

    Replace '2.9.0' with the libxml version that you need!

    0 讨论(0)
  • 2021-02-20 10:28

    It solved for me in mac by running

    gem install libxml-ruby -v '3.0.0' -- --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xml2-dir=/usr/local/opt/libxml2 --with-xml2-lib=/usr/local/opt/libxml2/lib --with-xml2-include=/usr/local/opt/libxml2/include

    0 讨论(0)
  • 2021-02-20 10:32

    Just happened today.

    $ brew link --force libxml2
    Warning: Refusing to link macOS-provided software: libxml2
    ...
    

    At first, I wasn't aware that there's a warning and it doesn't work anymore. Then found this workaround and it worked for me.

    bundle config build.libxml-ruby --use-system-libraries=true --with-xml2-include=/usr/local/opt/libxml2/include/libxml2/
    
    0 讨论(0)
  • 2021-02-20 10:37

    These steps worked for me (source)

    brew install libxml2
    bundle config --global build.libxml-ruby --with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config"
    

    then bundle install worked as expected

    0 讨论(0)
提交回复
热议问题