rake db:create
本番環境などでは何もできません。
実行gem install activerecord-mysql2-adapter
しましgem install mysql2
たが、両方とも既にインストールされているため、次のエラー メッセージが表示される理由がわかりません。
rake aborted!
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.)
/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in `block in replace_gem'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/mysql2_adapter.rb:3:in `<top (required)>'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:29:in `spec'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:101:in `create_database'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `block (3 levels) in <top (required)>'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `each'
/var/www/tools/vendor/cache/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:62:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p247@rails3-bootstrap-devise-cancan/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p247@rails3-bootstrap-devise-cancan/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:create
この問題の原因は何ですか?
以下は、フォルダー内の私のdatabase.yml
ファイルです。config
私がそれに変更production
するsqlite3
と動作します:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: mysql2
encoding: utf8
database: tools
username: root
password: pass
host: 127.0.0.1
port: 3306
cucumber:
<<: *test