Fixes for rubygems + Dir fix for 1.8