Additional changes so that this works for both CRuby and JRuby.

Previously the gem would fail for CRuby implementations. Now it conditionally requires gems based on the platform.