Permalink
Browse files

Refer to Rails.env only when Rails is defined

  • Loading branch information...
1 parent 5b12213 commit 524d4a35d2893396ba0d57b5eea853b11d5a57b9 @amatsuda amatsuda committed Nov 11, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/migration.rb
@@ -32,7 +32,11 @@ def initialize(name)
class PendingMigrationError < ActiveRecordError#:nodoc:
def initialize
- super("Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=#{::Rails.env}' to resolve this issue.")
+ if defined?(Rails)
+ super("Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=#{::Rails.env}' to resolve this issue.")
+ else
+ super("Migrations are pending; run 'bin/rake db:migrate' to resolve this issue.")
+ end
end
end

0 comments on commit 524d4a3

Please sign in to comment.