123456789_123456789_123456789_123456789_123456789_

Exception: ActiveRecord::EnvironmentMismatchError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveRecordError, StandardError
Instance Chain:
self, ActiveRecordError, StandardError
Inherits: ActiveRecord::ActiveRecordError
Defined in: activerecord/lib/active_record/migration.rb

Class Method Summary

Constructor Details

.new(current: nil, stored: nil) ⇒ EnvironmentMismatchError

[ GitHub ]

  
# File 'activerecord/lib/active_record/migration.rb', line 198

def initialize(current: nil, stored: nil)
  msg = +"You are attempting to modify a database that was last run in `#{ stored }` environment.\n"
  msg << "You are running in `#{ current }` environment. "
  msg << "If you are sure you want to continue, first set the environment using:\n\n"
  msg << "        bin/rails db:environment:set"
  if defined?(Rails.env)
    super("#{msg} RAILS_ENV=#{::Rails.env}\n\n")
  else
    super("#{msg}\n\n")
  end
end