Sha256: 3b3b89200f5e3982d7b059a4d77b445815149d5d5564d424582e3e82c928a96e

Contents?: true

Size: 1004 Bytes

Versions: 51

Compression:

Stored size: 1004 Bytes

Contents

module Fastlane
  module Actions
    # will make sure a gem is installed. If it's not an appropriate error message is shown
    # this will *not* 'require' the gem
    def self.verify_gem!(gem_name)
      begin
        Gem::Specification.find_by_name(gem_name)
        # We don't import this by default, as it's not always the same
        # also e.g. cocoapods is just required and not imported
      rescue Gem::LoadError
        UI.error("Could not find gem '#{gem_name}'")
        UI.error("")
        UI.error("If you installed fastlane using `sudo gem install fastlane` run")
        UI.command("sudo gem install #{gem_name}")
        UI.error("to install the missing gem")
        UI.error("")
        UI.error("If you use a Gemfile add this to your Gemfile:")
        UI.important("  gem '#{gem_name}'")
        UI.error("and run `bundle install`")

        UI.user_error!("You have to install the `#{gem_name}` gem on this machine") unless Helper.is_test?
      end
      true
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
fastlane-1.107.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.106.2 lib/fastlane/helper/gem_helper.rb
fastlane-1.106.1 lib/fastlane/helper/gem_helper.rb
fastlane-1.106.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.105.3 lib/fastlane/helper/gem_helper.rb
fastlane-1.105.2 lib/fastlane/helper/gem_helper.rb
fastlane-1.105.1 lib/fastlane/helper/gem_helper.rb
fastlane-1.105.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.104.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.103.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.102.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.101.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.100.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.99.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.98.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.97.2 lib/fastlane/helper/gem_helper.rb
fastlane-1.97.1 lib/fastlane/helper/gem_helper.rb
fastlane-1.97.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.96.0 lib/fastlane/helper/gem_helper.rb
fastlane-1.95.0 lib/fastlane/helper/gem_helper.rb