Permalink
Browse files

Handling Net::HTTP.request bug where @socket is nil

  • Loading branch information...
1 parent 084c819 commit 0a21959b1d9429d338c93aa53ccc05bc37776037 @akitaonrails akitaonrails committed with dcrec1 Feb 16, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/tasks/solr.rake
View
@@ -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

0 comments on commit 0a21959

Please sign in to comment.