Rubygems causes a warning on 1.9.3

aaron.patterson's Avatar


15 Nov, 2010 10:15 PM

I'm getting warnings in rubygems. The warning is this:

rubygems/gem_openssl.rb:45: warning: possibly useless use of :: in void context

Here is the patch I used to fix, but maybe a different patch would be better:

diff --git a/lib/rubygems/gem_openssl.rb b/lib/rubygems/gem_openssl.rb
index ade9564..029094d 100644
--- a/lib/rubygems/gem_openssl.rb
+++ b/lib/rubygems/gem_openssl.rb
@@ -42,7 +42,7 @@ begin
   # Reference a constant defined in the .rb portion of ssl (just to
   # make sure that part is loaded too).

-  OpenSSL::Digest::SHA1
+  _ = OpenSSL::Digest::SHA1

   Gem.ssl_available = true
  1. Support Staff 1 Posted by Nick Quaranto on 16 Nov, 2010 03:24 AM

    Nick Quaranto's Avatar

    Added John to this discussion.

  2. 2 Posted by mtodd on 16 Nov, 2010 05:36 AM

    mtodd's Avatar


    Gem.ssl_available = !!OpenSSL::Digest::SHA1

    At the risk of being "too clever" (aka, dumb).

  3. 3 Posted by John Barnette on 17 Nov, 2010 07:25 AM

    John Barnette's Avatar

    I'm on it.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac