
명령을 실행하려고 합니다.
rake db:setup RAILS_ENV="production"
하지만 다음과 같은 오류가 발생합니다.
DEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:mysql) instead. (called from call at /home/huzefa/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:240)
rake aborted!
ActiveRecord::AdapterNotSpecified: 'mysql' database is not configured. Available: ["default", "development", "test", "production", "adapter", "encoding", "reconnect", "database", "pool", "username", "password", "host"]
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:248:in `resolve_symbol_connection'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:231:in `resolve_string_connection'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:213:in `resolve_connection'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:139:in `resolve'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:151:in `block in resolve_all'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:150:in `each'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:150:in `resolve_all'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:69:in `resolve'
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/core.rb:46:in `configurations='
/home/huzefa/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:5:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config
내 database.yml
파일은 아래와 같습니다.
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# 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:
<<: *default
database: db/test.sqlite3
production:
adapter: mysql
encoding: utf8
reconnect: false
database: depot_production
pool: 5
username: huzefa
password: huzefa
host: localhost
여기서 프로덕션 환경에서 mysql 데이터베이스를 설정할 수 없도록 하는 누락된 부분은 무엇입니까? . 누군가 나를 도와줄 수 있다면 매우 필요할 것입니다. 감사합니다 :)
답변1
파일 에 들여쓰기 오류가 있어서 해결되었습니다 database.yml
.