我正在嘗試安裝Stanford-Core-NLP gem,這是使用Ruby進行自然語言處理的github上的主要項目之一。它爲Stanford-Core-NLP pakage提供了Ruby綁定,其中用Java編寫。當我嘗試下面的安裝說明第一步,那就是:無法安裝Stanford-Core-NLP Gem
gem install stanford-core-nlp
我得到以下錯誤:
ERROR: Error installing stanford-core-nlp:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-1.9.2-p320/bin/ruby 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/user/.rvm/rubies/ruby-1.9.2-p320/bin/ruby
extconf.rb:53:in `<main>': JAVA_HOME is not set. (RuntimeError)
我正在其中根據回購的Ruby 1.9.2,是gem已經過測試的最新版本和Java 1.7.0_40。我也試過尋找mkmf.log文件,但無法找到它。
是你的JAVA_HOME集? – kristianp
@kristianp感謝您的回覆。爲了回答你的問題,我認爲它沒有正確設置。我只是嘗試根據三個不同的教程來設置它,但當我嘗試安裝gem時,仍然收到相同的錯誤消息。 – HMLDude
你正在運行哪個操作系統? 'ruby -v'說什麼? –