Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 0a21959b1d9429d338c93aa53ccc05bc37776037 1 parent 084c819
@akitaonrails akitaonrails authored dcrec1 committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/tasks/solr.rake
View
4 lib/tasks/solr.rake
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.