Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#5464

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>'

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

State: committed
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to José Valim
    • Importance changed from to Low

    August 27th, 2010 @ 02:29 PM

  2. José Valim
  3. viktor tron (strawberry)
    viktor tron (strawberry)

    it seems this problem persists in that the adapter still requires the mysql gem?
    The only way I could avoid this was putting
    gem 'mysql'
    gem 'mysql2'
    in my Gemfile

    is this normal?

    January 12th, 2011 @ 02:28 PM

  4. Goksel
    Goksel
    • Assigned user cleared.

    This can be a Mysql version problem. You should install the most stable version (MYSQL 5.1). See me blog post : http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-o...

    January 18th, 2011 @ 01:32 AM