Search code examples
windowsjrubyonrails

Unable to access jarfile start.jar when trying to use sunspot solr with JRuby on Rails on Windows 7 x64


My team and I are working on developing a JRuby on Rails application on top of Red Hat Enterprise Linux. Our customer may be asking us to convert to having it run on top of Windows, so I am starting to do some preliminary pathfinding using a Windows 7 x64 machine.

I've gotten jruby -S rake db:drop, db:create, and db:migrate tasks to work correctly. However, I've been unable to get rake db:seed to work because we use Sunspot and need to get it running before db:seed will work correctly. When I try running rake sunspot:solr:run --trace, I get the following output:

** Invoke sunspot:solr:run (first_time)
** Invoke environment (first_time)
** Execute environment
Using dev environment: development
** Execute sunspot:solr:run
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
Unable to access jarfile start.jar

My guess has been that this is related to a classpath issue or something along those lines, but I've been able to figure out what exactly is going wrong. I've tried some things both with passing classpath arguments to JRuby and with modifying the classpath in application.rb, but have yet to come up with any working solution.

I was hoping some folks might have an answer or some ideas. Thanks!


Solution

  • I was finally able to solve this by some information I found in an issue on sunspot's section of github: https://github.com/sunspot/sunspot/issues/163

    Basically had to open up sunspot/solr/server.rb and, in line 104, change exec(...) to system(...)