2017-04-27 5 views
0

을 ConnectionNotEstablished :해결할 보석은, 몽고는 액티브 테스트 : 모든 테스트가 오류와 함께 실패 수습 보석을 추가 한 후

ActiveRecord::ConnectionNotEstablished: 
No connection pool for ActiveRecord::Base 

우리가 사용하고 있습니다 :
보석 :

  • 레일 4.2.8을
  • 몽고 이드 5
  • 1 정류 0.9.1
  • ,363,210
  • RSpec에 3.4.4

또 다른 :

  • OS : 우분투 16.04LTE
  • MongoDB를 : 고정 표시기-작성하여 실행 3.4.3
  • 데이터베이스.
  • 고정 표시기-작성 버전 1.12.0

개발 모드 모든 것에 잘 작동합니다.
mongoid.yml

development: 
    clients: 
    default: 
     database: development 
     hosts: 
     - localhost:27017 
     options: 
     heartbeat_frequency: 10 
     local_threshold: 0.015 
     server_selection_timeout: 30 
     max_pool_size: 5 
     min_pool_size: 1 
     wait_queue_timeout: 1 
     connect_timeout: 10 
     socket_timeout: 5 
     ssl: false 
     ssl_cert: /path/to/my.cert 
     ssl_key: /path/to/my.key 
     ssl_key_pass_phrase: password 
     ssl_verify: true 
     ssl_ca_cert: /path/to/ca.cert 
    options: 
    include_root_in_json: false 
    include_type_for_serialization: false 
    preload_models: false 
    raise_not_found_error: false 
    scope_overwrite_exception: false 
    use_activesupport_time_zone: true 
    use_utc: false 
    log_level: debug 

test: 
    clients: 
    default: 
     database: test 
     hosts: 
     - localhost:27017 
     options: 
     heartbeat_frequency: 10 
     local_threshold: 0.015 
     server_selection_timeout: 30 
     max_pool_size: 1 
     min_pool_size: 1 
     wait_queue_timeout: 4 
     connect_timeout: 10 
     socket_timeout: 5 
     ssl: false 
     ssl_cert: /path/to/my.cert 
     ssl_key: /path/to/my.key 
     ssl_key_pass_phrase: password 
     ssl_verify: true 
     ssl_ca_cert: /path/to/ca.cert 
    options: 
    include_root_in_json: false 
    include_type_for_serialization: false 
    preload_models: false 
    raise_not_found_error: false 
    scope_overwrite_exception: false 
    use_activesupport_time_zone: true 
    use_utc: false 
    log_level: debug 

스택 트레이스이 테스트 데이터베이스 구성에 대한 몇 가지 간단한 실수를하지만 난 정확히 알아낼 수 없습니다처럼

ActiveRecord::ConnectionNotEstablished: 
    No connection pool for ActiveRecord::Base 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:570:in `retrieve_connection' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:in `retrieve_connection' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in `connection' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/fixtures.rb:501:in `create_fixtures' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/fixtures.rb:979:in `load_fixtures' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/fixtures.rb:952:in `setup_fixtures' 
# /home/user_home_directory/.rvm/gems/[email protected]/gems/activerecord-4.2.8/lib/active_record/fixtures.rb:826:in `before_setup' 

보인다.
도움이 될 것입니다. 고맙습니다!

답변

0

수정 버전 0.9.1은 몽고 이드를 지원하지 않습니다.
Link 적절한 문제.