Java runtime error when trying to install sunspot

I've seen other blogs and questions related to this issue, but none of them seem to help. I am trying to install sunspot with solr, however I keep getting an error when I run the following command:

bundle exec rake sunspot:solr:start

      

The trace from running the command:

** Invoke sunspot:solr:run (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:solr:run
/home/i7core/.rvm/gems/ruby-1.9.3-p125/bin/rake: No such file or directory - java -version
rake aborted!
You need a Java Runtime Environment to run the Solr server

      

My gemfile:

gem 'sunspot_rails', '~> 1.3.0'
gem 'sunspot_solr'

      

It looks like I don't have a Java runtime, but I have already installed java. Not sure what to do. There have been a few github issues as well and everything seems to work with the latest version, but I still can't get it to work. Please, help.

+3


source to share


2 answers


You need Java JRE installed, like Oracle or OpenJDK version for me. Also, make sure the java executable is in your path the rake task can see.



+2


source


One quick way to install JRE on Ubuntu:



sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

      

+5


source







All Articles