Harish
Harish

Reputation: 131

Running jruby application with Elastic Search gem.

I'm trying to generate a compiled application of the Rails project using jruby and host it on Tomcat server. I'm struggling to establish the connection with elasticsearch after compiling.

Following are the steps I've taken:

When I run the application directly using rails s it is working as expected.

But when I compile the application and run on Tomcat server I'm getting the following error

Internal Server Error (500)
Request Method:     GET
Request URL:    http://localhost:8080/blog/
java.lang.NullPointerException
You're seeing this error because you use    JRuby::Rack::ErrorApp::ShowStatus.

Upvotes: 3

Views: 533

Answers (1)

Harish
Harish

Reputation: 131

The solution is to include the required gem in warble.conf file.

Warbler::Config.new do |config|
  config.features = %w(FEATURE)
  config.features = %w(gemjar)
  config.gems["elasticsearch"]
end+

Upvotes: 3

Related Questions