Rails 3.2.12 + rails_admin =数据库配置未指定适配器问题

时间:2013-06-18 07:12:23

标签: ruby-on-rails sql-server activerecord rails-admin

我正在尝试在mssql 2005上安装rails_admin

Rails 3.2.12   
ruby 1.9.3  
tiny_tds (0.5.1-x86-mingw32)   
activerecord-sqlserver-adapter (~> 3.2.0) 

rails g rails_admin:install 给我一个错误:

c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.12/lib/active_record/c
onnection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_conn
ection': database configuration does not specify adapter (ActiveRecord::AdapterN
otSpecified)
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.12/lib/ac
tive_record/connection_adapters/abstract/connection_specification.rb:41:in `reso
lve_string_connection'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.12/lib/ac
tive_record/connection_adapters/abstract/connection_specification.rb:27:in `spec
'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.12/lib/ac
tive_record/connection_adapters/abstract/connection_specification.rb:130:in `est
ablish_connection'
        from d:/sites/efiling2/app/models/maininfo.rb:2:in `<class:Maininfo>'
        from d:/sites/efiling2/app/models/maininfo.rb:1:in `<top (required)>'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:469:in `load'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:469:in `block in load_file'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:639:in `new_constants_in'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:468:in `load_file'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:353:in `require_or_load'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:502:in `load_missing_constant'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:192:in `block in const_missing'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:190:in `each'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:190:in `const_missing'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/inflector/methods.rb:230:in `block in constantize'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/inflector/methods.rb:229:in `each'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/inflector/methods.rb:229:in `constantize'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/core_ext/string/inflections.rb:54:in `constantize'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rails_admin-0.4.9/lib/rail
s_admin/abstract_model.rb:18:in `new'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rails_admin-0.4.9/lib/rail
s_admin/abstract_model.rb:12:in `block in all'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rails_admin-0.4.9/lib/rail
s_admin/abstract_model.rb:12:in `map'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rails_admin-0.4.9/lib/rail
s_admin/abstract_model.rb:12:in `all'
        from (erb):30:in `template'
        from c:/ruby/Ruby193/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from c:/ruby/Ruby193/lib/ruby/1.9.1/erb.rb:838:in `result'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/file_manipulation.rb:117:in `block in template'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:54:in `call'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:54:in `render'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:47:in `identical?'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:73:in `on_conflict_behavior'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/empty_directory.rb:114:in `invoke_with_conflict_check'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:61:in `invoke!'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns.rb:95:in `action'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/create_file.rb:26:in `create_file'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/actio
ns/file_manipulation.rb:116:in `template'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/rails_admin-0.4.9/lib/gene
rators/rails_admin/install_generator.rb:69:in `install'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/comma
nd.rb:27:in `run'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invoc
ation.rb:120:in `invoke_command'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invoc
ation.rb:127:in `block in invoke_all'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invoc
ation.rb:127:in `each'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invoc
ation.rb:127:in `map'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invoc
ation.rb:127:in `invoke_all'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/group
.rb:233:in `dispatch'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.
rb:439:in `start'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.12/lib/rails/
generators.rb:171:in `invoke'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.12/lib/rails/
commands/generate.rb:12:in `<top (required)>'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:251:in `require'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:251:in `block in require'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:236:in `load_dependency'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/a
ctive_support/dependencies.rb:251:in `require'
        from c:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.12/lib/rails/
commands.rb:29:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

database.yml

development:
  adapter: sqlserver
  host: 10.11.10.56
  database: efiling
  username: ndcpe   
  encoding: utf8

production:
  adapter: sqlserver
  host: 10.10.16.4
  database: efiling
  username: ndcpe  
  encoding: utf8

test:
  adapter: sqlserver
  host: 10.11.10.56
  database: efiling
  username: ndcpe 
  encoding: utf8

earchive_database:
  adapter: sqlserver
  host: 10.10.16.4
  database: Inet_Data_Docs
  username: ndcpe
  encoding: utf8

cucumber:
  adapter: sqlserver
  host: 10.11.10.56
  database: efiling
  username: ndcpe 
  encoding: utf8

目前还不清楚为什么在出现适配器规范时会出现此错误?

1 个答案:

答案 0 :(得分:0)

我找到了错误的原因。有一个模型在数据库中没有表。 但是rails_admin没有给我任何关于此的信息。