我正在尝试安装Stanford-Core-NLP gem,这是 github 上使用 Ruby 进行自然语言处理的主要项目之一。它为用 Java 编写的 Stanford-Core-NLP 包提供 Ruby 绑定。当我尝试按照安装说明的第一步进行操作时,即:
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,根据 repo,它是 gem 已经测试过的最新版本和 Java 1.7.0_40。我还尝试查找 mkmf.log 文件,但无法找到它。