新建至铁路, 我想使用 < em> 铁路控制台沙箱 < / em > 测试一些关联。 我创建了一个非常基本的应用程序, 并且 < em > 铁路控制台 < / em > 运作良好 。
我安装了活性支持宝石
当我运行 $ActionRecord::Base. configations[Rails.env][适配器]
命令时,它报告数据库是 sqlite3 (正确)。
但当我试图使用控制台的“ sandbox” 版本时, 我发现错误如下:
/Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection : database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:39:in `resolve_string_connection
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:23:in `spec
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:127:in `establish_connection
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/railtie.rb:76:in `block (2 levels) in <class:Railtie>
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `each
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/base.rb:721:in `<top (required)>
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.3/lib/active_record/railtie.rb:41:in `block in <class:Railtie>
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie.rb:179:in `call
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie.rb:179:in `block in load_console
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie.rb:179:in `each
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/railtie.rb:179:in `load_console
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:429:in `block in load_console
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/application/railties.rb:8:in `each
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/application/railties.rb:8:in `all
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/engine.rb:429:in `load_console
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/application.rb:153:in `load_console
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands/console.rb:27:in `start
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start
from /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>
我不知道这个错误告诉我什么, 因为我正确地设置了数据库. yml 文件, 并且用标准控制台将数据写入数据库。 我不知道如何解决这个问题 。