diff --git a/fastlane/lib/fastlane/setup/setup.rb b/fastlane/lib/fastlane/setup/setup.rb index dd6f4e5c238..6ed46b9a01b 100644 --- a/fastlane/lib/fastlane/setup/setup.rb +++ b/fastlane/lib/fastlane/setup/setup.rb @@ -244,7 +244,7 @@ def setup_gemfile! def ensure_gemfile_valid!(update_gemfile_if_needed: false) gemfile_content = File.read(gemfile_path) - unless gemfile_content.include?("https://rubygems.org") + unless gemfile_content.lines.any? { |line| URI(line.strip).host == "rubygems.org" rescue false } UI.error("You have a local Gemfile, but RubyGems isn't defined as source") UI.error("Please update your Gemfile at path `#{gemfile_path}` to include") UI.important("")