Permalink
Browse files

Error message should advice to use 'mysql2' gem.

If I create a new app using command
rails new demo -d mysql
then Gemfile contains 'mysql2' gem by default.

However if mysql gem is missing then error message says
raise "!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'"

[#5569 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 8765e06 commit 3c36c12a6507736398b525f8052ac1a1146ede8a Neeraj Singh committed with spastorino Sep 22, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
View
4 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -19,11 +19,11 @@ def self.mysql_connection(config) # :nodoc:
begin
require 'mysql'
rescue LoadError
- raise "!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'"
+ raise "!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql2'"
end
unless defined?(Mysql::Result) && Mysql::Result.method_defined?(:each_hash)
- raise "!!! Outdated mysql gem. Upgrade to 2.8.1 or later. In your Gemfile: gem 'mysql', '2.8.1'"
+ raise "!!! Outdated mysql gem. Upgrade to 2.8.1 or later. In your Gemfile: gem 'mysql', '2.8.1'. Or use gem 'mysql2'"
end
end

0 comments on commit 3c36c12

Please sign in to comment.