diff options
author | David RodrÃguez <deivid.rodriguez@gmail.com> | 2015-07-11 15:22:30 -0300 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@gmail.com> | 2015-07-11 15:51:51 -0300 |
commit | f48dc782167fea0a1f13759ed6596a004dd746f3 (patch) | |
tree | 5b0caf96c13b55bdd0f7a2e1e627bd12dd4fe0ed /activerecord/lib/active_record/tasks | |
parent | 14354f195540954a1dfc5c954d06389c9f71e986 (diff) | |
download | rails-f48dc782167fea0a1f13759ed6596a004dd746f3.tar.gz rails-f48dc782167fea0a1f13759ed6596a004dd746f3.tar.bz2 rails-f48dc782167fea0a1f13759ed6596a004dd746f3.zip |
Fix undefined method error on exception
The `error` method is not defined, in general, for exceptions. Instead,
print the exception message. This error was hiding actual meaningful DB
configuration errors. See http://stackoverflow.com/questions/18774463.
Diffstat (limited to 'activerecord/lib/active_record/tasks')
-rw-r--r-- | activerecord/lib/active_record/tasks/mysql_database_tasks.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb index 673386f0d9..ba5dd0a0d9 100644 --- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb @@ -23,7 +23,7 @@ module ActiveRecord end rescue error_class => error if error.respond_to?(:errno) && error.errno == ACCESS_DENIED_ERROR - $stdout.print error.error + $stdout.print error.message establish_connection root_configuration_without_database connection.create_database configuration['database'], creation_options if configuration['username'] != 'root' |