我搜索了整個網絡尋找解決此錯誤的方法。但它不會讓步。根據我的知識,我安裝了所有的庫和依賴項,甚至卸載了ruby和nokogiri並重新安裝。但是這個錯誤仍然存在。 我正在嘗試在紅寶石中安裝OpenGraph寶石
Gem files will remain installed in /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7 for inspection.
Results logged to /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.4.7/gem_make.out
這是從這個位置gem_make.out日誌文件 - > /.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/ 2.4.0靜電/引入nokogiri-1.4.7/gem_make.out
ERROR: Error installing opengraph:
\t ERROR: Failed to build gem native extension.
current directory: /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7/ext/nokogiri
/home/$User/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20171125-15877-nibcps.rb extconf.rb --with-nokogiri-dir=/home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/
*** 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:
\t --with-opt-dir
\t --without-opt-dir
\t --with-opt-include
\t --without-opt-include=${opt-dir}/include
\t --with-opt-lib
\t --without-opt-lib=${opt-dir}/lib
\t --with-make-prog
\t --without-make-prog
\t --srcdir=.
\t --curdir
\t --ruby=/home/$User/.rbenv/versions/2.4.2/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
CONFIG
extconf failed, exit code 1
P.S:我沒有使用opengraph_parser,因爲它有一個回退方法。我需要opengraph寶石,因爲我需要捕捉異常。
Hi..thanks的答覆。但我使用的是Fedora 26.你能告訴我Fedora或任何Redhat的類似依賴嗎? – Meimo
@Meimo ruby-devel zlib-devel。更新了我的答案。 – jemonsanto
感謝您再次回覆,但我試圖安裝這些依賴關係時...終端說「已安裝,無事可做」。看到我告訴你,根據我的知識安裝一切。但它只是不會安裝。我認爲這是一個錯誤。 – Meimo