c:\row\dev\hello_world>db:create
The filename, directory name, or volume label syntax is incorrect.
c:\row\dev\hello_world>rake db:create
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:55:in `resolve_hash_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:34:in `spec'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:39:in `establish_connection'
c:in `establish_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/mysql_database_tasks.rb:15:in `create'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:73:in `create'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:87:in `block in create_current'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:182:in `each'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:86:in `create_current'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:20:in `block (2 levels) in <top (required)>'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:240:in `call'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:235:in `each'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
c:/row/Ruby200/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `each'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:75:in `run'
c:/row/Ruby200/bin/rake:33:in `<main>'
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "database"=>"hello_world_development", "pool"=>5, "username"=>"root", "password"=>"axel24", "host"=>"localhost"}
Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:55:in `resolve_hash_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/connection_specification.rb:34:in `spec'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:39:in `establish_connection'
c:in `establish_connection'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/mysql_database_tasks.rb:15:in `create'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:73:in `create'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:87:in `block in create_current'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:182:in `each'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/tasks/database_tasks.rb:86:in `create_current'
c:/row/Ruby200/lib/ruby/gems/2.2.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:20:in `block (2 levels) in <top (required)>'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:240:in `call'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:235:in `each'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
c:/row/Ruby200/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
c:/row/Ruby200/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `each'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
c:/row/Ruby200/lib/ruby/2.2.0/rake/application.rb:75:in `run'
c:/row/Ruby200/bin/rake:33:in `<main>'
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "database"=>"hello_world_test", "pool"=>5, "username"=>"root", "password"=>"axel24", "host"=>"localhost"}
rake aborted!
**Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
Gem::LoadError: can't activate mysql2 (~> 0.3.18), already activated mysql2-0.4.1-x86-mingw32. Make sure all dependencies are added to Gemfile.**
Tasks: TOP => db:create
(See full trace by running task with --trace)
Asked
Active
Viewed 393 times
-2

spickermann
- 100,941
- 9
- 101
- 131

Vivid Debugger
- 83
- 2
- 11
-
Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile. – 7stud Nov 09 '15 at 07:14
-
1Maybe better - http://stackoverflow.com/questions/22932282/gemloaderror-specified-mysql2-for-database-adapter-but-the-gem-is-not-loade – Brad Werth Nov 09 '15 at 07:49
-
None of these worked ): – Vivid Debugger Nov 10 '15 at 00:28
1 Answers
1
The error messages are pretty specific. They tell you multiple times:
**Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile.
Add gem 'mysql2'
to your Gemfile
and run:
bundle install
again.

spickermann
- 100,941
- 9
- 101
- 131
-
@spickermann IDK why you received a down vote... With the details OP provided, your solution seems good. OP should really include more, if possible, than just the error log. – onebree Nov 09 '15 at 13:51
-
This didn't work, I still get the error. I didn't down vote it though – Vivid Debugger Nov 09 '15 at 22:07
-
@VividDebugger : Do you have the same problem when you use `bundle exec rake db:create`? – spickermann Nov 10 '15 at 07:52
-
A possible reason for this could also be that the `mysql2` gem version is incompatible to the ruby version being used here. Kindly try using `gem 'mysql2', '~> 0.3.18` and bundle again. – elixir May 24 '18 at 12:02