Skip to content

Commit

Permalink
Handling Net::HTTP.request bug where @socket is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaonrails authored and dcrec1 committed Feb 17, 2010
1 parent 084c819 commit 0a21959
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tasks/solr.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ namespace :solr do
rescue Net::HTTPServerException #responding
puts "Port #{SOLR_PORT} in use" and return

rescue Errno::ECONNREFUSED, Errno::EBADF #not responding
rescue Errno::ECONNREFUSED, Errno::EBADF, NoMethodError #not responding
# there's an issue with Net::HTTP.request where @socket is nil and raises a NoMethodError
# http://redmine.ruby-lang.org/issues/show/2708
Dir.chdir(SOLR_PATH) do
cmd = "java #{SOLR_JVM_OPTIONS} -Djetty.logs=\"#{SOLR_LOGS_PATH}\" -Dsolr.solr.home=\"#{SOLR_CONFIG_PATH}\" -Dsolr.data.dir=\"#{SOLR_DATA_PATH}\" -Djetty.port=#{SOLR_PORT} -jar start.jar"
puts "Executing: " + cmd
Expand Down

0 comments on commit 0a21959

Please sign in to comment.