database.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: mysql2
database: date_around
pool: 5
timeout: 5000
username: root
encoding: utf8
host: localhost
# password:
# 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:
adapter: mysql2
database: date_around
pool: 5
timeout: 5000
username: root
encoding: utf8
host: localhost
password:
production:
adapter: mysql2
database: date_around
pool: 5
timeout: 5000
username: root
encoding: utf8
host: localhost
password:
数据库配置如上,
错误信息如下
database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:52:in `resolve_hash_connection'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:46:in `resolve_string_connection'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:39:in `establish_connection'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/railtie.rb:176:in `block (2 levels) in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/base.rb:322:in `<module:ActiveRecord>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/base.rb:22:in `<top (required)>'
/home/root/www/sample_app/app/models/user.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:330:in `require_or_load'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:289:in `depend_on'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:207:in `require_dependency'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:464:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:464:in `block in eager_load!'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:462:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:462:in `eager_load!'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/engine.rb:347:in `eager_load!'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/application/finisher.rb:56:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/application.rb:215:in `initialize!'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/root/www/sample_app/config/environment.rb:5:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.39/helper-scripts/rack-preloader.rb:28:in `<main>'
上面说数据库不适配,我的 database.yml 设置跟另一个运行正常的的文件模板一样的,我想不是 database.yml 的原因。。
————————————————————————————
还有一个重要的信息:::项目启动了之后,数据库中没有生成对应的数据库!
运行一个叫做 rain 的项目能够正常运转,换成别的项目就不行了,(nginx.conf 已经修改),已经尝试多个项目,都无法正常运行,,