Improve gem detection in Gemfile