Prevent JRuby rubygems warnings from breaking the build

/cc @myronmarston 
I believe it'd still need the `defined?` for 1.8.7 and would be a longer character count...