This project is archived and is in readonly mode.

#5464 ✓committed
Sam Aarons

"uninitialized constant Mysql" during rake db:create using em_mysql2

Reported by Sam Aarons | August 26th, 2010 @ 08:35 AM

When rake db:create is run using the em_mysql2 adapter, Rails wrongly assumes it is suppose to throw a Mysql::Error instead of a Mysql2::Error. I have attached a patch that fixes this problem.

rake aborted!
uninitialized constant Mysql
~/.bundler/ruby/1.9.1/rails-5dd9272/activerecord/lib/active_record/railties/databases.rake:64:in `rescue in create_database'
~/.bundler/ruby/1.9.1/rails-5dd9272/activerecord/lib/active_record/railties/databases.rake:39:in `create_database'
~/.bundler/ruby/1.9.1/rails-5dd9272/activerecord/lib/active_record/railties/databases.rake:35:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/local/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/local/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/local/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/local/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/local/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/local/bin/rake:31:in `<main>'

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Pages