summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2015-12-27 02:01:37 -0500
committerJames Wen <jrw2175@columbia.edu>2015-12-27 02:01:37 -0500
commit397710eaa10f84690e3614b8c8698f2f9cfd28c9 (patch)
treeb936292381bab382c6f166db9c436fc8238f5c21
parente2b14375c3ed2ef679fed1ca894dd346cbcefcf1 (diff)
downloadbundler-397710eaa10f84690e3614b8c8698f2f9cfd28c9.tar.gz
Catch NoMethodError for `use_ssl=` and raise appropriate FriendlyErrors warning
-rw-r--r--lib/bundler/fetcher/downloader.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index 8efeb14461..3e05b77d5e 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -43,6 +43,12 @@ module Bundler
req.basic_auth(user, password)
end
connection.request(uri, req)
+ rescue NoMethodError => e
+ if ["undefined method", "use_ssl="].all? {|snippet| e.message.include? snippet }
+ raise LoadError.new("cannot load such file -- openssl")
+ else
+ raise e
+ end
rescue OpenSSL::SSL::SSLError
raise CertificateFailureError.new(uri)
rescue *HTTP_ERRORS => e