diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-08 22:34:09 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-08 22:34:09 -0700 |
commit | d20035910c186401c1d957462f4ad7894347c398 (patch) | |
tree | b5dee379897add36d392d748f7a252dc5779d6a8 /activerecord | |
parent | def594b92d1e68db68a27d53dec7ae4e6246f5a5 (diff) | |
download | rails-d20035910c186401c1d957462f4ad7894347c398.tar.gz rails-d20035910c186401c1d957462f4ad7894347c398.tar.bz2 rails-d20035910c186401c1d957462f4ad7894347c398.zip |
Give a more informative error message instead of just raising a load error when mysql gem isn't installed
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index cfd2402d9d..076b7f63c2 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -58,7 +58,14 @@ module ActiveRecord end # Require the MySQL driver and define Mysql::Result.all_hashes - require_library_or_gem('mysql') unless defined? Mysql + unless defined? Mysql + begin + require_library_or_gem('mysql') + rescue LoadError + $stderr.puts '!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.' + raise + end + end MysqlCompat.define_all_hashes_method! mysql = Mysql.init |