Skip to content

issue with rake sunspot:solr:run failing with JRUBY 1.7.0.preview2 #267

Closed
wants to merge 2 commits into from
@leh
leh commented Aug 10, 2012

The upcomming jruby 1.7 release changes the behavior of Kernel#exec
which leads the rake task sunspot:solr:run to fail with message "Error:
Unable to access jarfile start.jar".
After replacing Kernel#exec with Kernel#system the rake task works
again.

@leh leh Fix issue with rake sunspot:solr:run failing with JRUBY 1.7.0.preview2
The upcomming jruby 1.7 release changes the behavior of Kernel#exec
which leads the rake task sunspot:solr:run to fail with message "Error:
Unable to access jarfile start.jar".
After replacing Kernel#exec with Kernel#system the rake task works
again.
78717a3
@travisbot

This pull request passes (merged 78717a3 into f865b1d).

@benmoss
benmoss commented Sep 3, 2012

Are you running on Windows? exec should be fixed in JRuby, but it seems from bundler/bundler#1689 that it still is broken on Windows.

@vosechu
vosechu commented Sep 11, 2012

This fixes me on OS X. Otherwise it fails.

@leh
leh commented Sep 12, 2012

We are using LInux. But I'll have another look into this with JRuby 1.7RC1

@vosechu
vosechu commented Sep 12, 2012

Thanks @leh

@tay
tay commented Nov 9, 2012

We are using jruby 1.7.0 on OS X and just experienced this problem. @leh's patch fixes it for us.

@ebeigarts

system leaves orphaned solr process when the rake task is killed with kill -TERM ....

The only way to get it working for me was:

FileUtils.cd(File.dirname(solr_jar)) do
  require "childprocess"
  process = ChildProcess.build(*command)
  trap('TERM') do
    puts "Killing solr"
    process.stop
    exit 0
  end
  process.io.inherit!
  process.start
  process.wait
end
@krisleech

I am having the same issue of JRuby 1.7.4, What do you add to your Gemfile to try this commit?

gem 'sunspot_rails', :git => 'https://github.com/taktsoft/sunspot'
gem 'sunspot_solr',  :git => 'https://github.com/taktsoft/sunspot' 
@krisleech

I just needed gem 'sunspot_solr', :git => 'https://github.com/taktsoft/sunspot' and I can confirm it works.

@leh
leh commented May 21, 2013

I'm glad that the patched version works for you. Please be cautious as this may not be the best of all solutions - see @ebeigarts comment

@amalagaura

Will this be pull request be accepted? Jruby 1.7.4 is the standard now and we need to be able to at least run the solr server in development with JRuby

@fny
fny commented Aug 23, 2013

I can confirm that this fixes the issue when running the vanilla command to start a sunspot server: jruby -S sunspot-solr run

@robbiegill robbiegill pushed a commit to robbiegill/sunspot that referenced this pull request Dec 30, 2013
Robbie Gill fix for jruby from sunspot#267 fc31991
@krisleech

I had some luck with JRuby 1.7.10 and Sunspot 2.1. I had to create a new directory, "collection1", in "solr" and move "conf" in to that directory. I then had to use the sunspot-solr command to start Solr.

@ma2kubo
@joneslee85
Sunspot member

I am going to close this issue since this version is out of date. Feel free to create a new one if the latest version does not work for you.

@joneslee85 joneslee85 closed this Mar 3, 2015
@kevin-alpine kevin-alpine referenced this pull request in kevin-alpine/chorus-upgrade May 21, 2015
Open

Rails 4.0.13: upgrade Sunspot (DO NOT MERGE) #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.