class Bundler::CLI::Outdated

def check_for_deployment_mode

def check_for_deployment_mode
  return unless Bundler.frozen_bundle?
  suggested_command = if Bundler.settings.locations("frozen")[:global]
    "bundle config --delete frozen"
  elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
    "bundle config --delete deployment"
  else
    "bundle install --no-deployment"
  end
  raise ProductionError, "You are trying to check outdated gems in " \
    "deployment mode. Run `bundle outdated` elsewhere.\n" \
    "\nIf this is a development machine, remove the " \
    "#{Bundler.default_gemfile} freeze" \
    "\nby running `#{suggested_command}`."
end