def choose_best_gem
      gems_to_try = []
      #puts "Ruby MAJOR: #{Rest.ruby_major}"
      if Rest.ruby_major >= 2
        gems_to_try << :net_http_persistent
        gems_to_try << :typhoeus
        gems_to_try << :rest_client
        gems_to_try << :internal
      else
        # net-http-persistent has issues with ssl and keep-alive connections on ruby < 1.9.3p327
        gems_to_try << :typhoeus
        gems_to_try << :rest_client
        gems_to_try << :internal
      end
      gems_to_try.each_with_index do |g, i|
        bg = Rest.backing_gems[g]
        begin
          require bg.gem_name unless g == :internal
          @gem = bg.name
          return @gem
        rescue LoadError => ex
          if (i+1) >= gems_to_try.length
            raise ex
          end
          @logger.debug "LoadError on #{bg.name}, trying #{Rest.backing_gems[gems_to_try[i+1]].name}..."
        end
      end
    end
def choose_best_gem
      gems_to_try = []
      #puts "Ruby MAJOR: #{Rest.ruby_major}"
      if Rest.ruby_major >= 2
        gems_to_try << :net_http_persistent
        gems_to_try << :typhoeus
        gems_to_try << :rest_client
        gems_to_try << :internal
      else
        # net-http-persistent has issues with ssl and keep-alive connections on ruby < 1.9.3p327
        gems_to_try << :typhoeus
        gems_to_try << :rest_client
        gems_to_try << :internal
      end
      gems_to_try.each_with_index do |g, i|
        bg = Rest.backing_gems[g]
        begin
          require bg.gem_name unless g == :internal
          @gem = bg.name
          return @gem
        rescue LoadError => ex
          if (i+1) >= gems_to_try.length
            raise ex
          end
          @logger.debug "LoadError on #{bg.name}, trying #{Rest.backing_gems[gems_to_try[i+1]].name}..."
        end
      end
    end
options:
 - :gem => specify gem explicitly