无法安装1.4.3引入nokogiri宝石(Can't install Nokogiri 1

2019-10-23 03:18发布

无法安装1.4.3引入nokogiri宝石。 引入nokogiri 1.6.6.2安装没有问题。 使用Ubuntu的最新RVM。

pm@sniegas:~$ gem install nokogiri -v '1.4.3'
Fetching: nokogiri-1.4.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /home/pm/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150519-7580-2yzgsg.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/pm/.rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)

extconf failed, exit code 1

Gem files will remain installed in /home/pm/.rvm/gems/ruby-2.2.1/gems/nokogiri-1.4.3 for inspection.
Results logged to /home/pm/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/nokogiri-1.4.3/gem_make.out

我应该从哪里开始寻找一个解决方案吗?

Answer 1:

我设法1.4.7通过做(接近)安装以下:

git clone git@github.com:sparklemotion/nokogiri.git
cd nokogiri
gem install rake-compiler hoe racc rexical
git checkout v1.4.7 # 1.4.3 in your case
# edit ./ext/nokogiri/extconf.rb and replace `Config` with `RbConfig`
rake install_deps
rake install_gem

但愿我没有忘记的一个步骤。

编辑:从头开始的,安装的创业板不能正常工作。 我要离开这里了这个现在的情况下,它可以帮助别人。

编辑(乔纳斯):提示该解决方案是一个bug报告 。 我坚持使用Ruby 2.1.5,它解决了这个问题。



文章来源: Can't install Nokogiri 1.4.3 gem