Nokogiri issues with Ruby on Rails

前端 未结 3 1330
耶瑟儿~
耶瑟儿~ 2021-01-06 15:57

I\'m trying to install nokogiri on my machine but I am receiving the following error:

Building native extensions.  This could take a while...
ERROR:  Error          


        
相关标签:
3条回答
  • 2021-01-06 16:25

    After combining many solutions from git issues and SO, this worked for me:

    gem install nokogiri -v '1.6.7' -n /usr/local/bin -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/
    

    Although I did prepend sudo.

    0 讨论(0)
  • 2021-01-06 16:29

    This seems to be a common issue. You can check the following link

    http://www.nokogiri.org/tutorials/installing_nokogiri.html

    You will need to update the Rubygems to 2.4.5 or later and also check whether development tools is installed on you pc.

    Or you can do the following if you are using bundle

    gem update --system
    gem install nokogiri -- --use-system-libraries
    bundle config build.nokogiri --use-system-libraries
    bundle install
    
    0 讨论(0)
  • 2021-01-06 16:29

    I had to use version 1.6.7.rc4-x64-mingw32 (I'm on Windows). Added this line to my Gemfile:

    gem 'nokogiri', '~> 1.6', '>= 1.6.7.rc4'
    
    0 讨论(0)
提交回复
热议问题