2014-02-17 80 views
0

我已經嘗試了各種解決方案,包括下面的這一個,但仍然得到相同的錯誤。欣賞任何線索。ActiveRecord :: ConnectionNotEstablished在AWS OpsWorks

Removing database.yml when using Mongoid in Rails 3.2

[email protected]:/srv/www/myapp/current/log# cat unicorn.stderr.log 
I, [2014-02-15T13:59:29.053668 #19768] INFO -- : Refreshing Gem list 
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. 
I, [2014-02-15T14:00:11.666899 #19768] INFO -- : listening on addr=/srv/www/myapp/shared/sockets/unicorn.sock fd=14 
E, [2014-02-15T14:00:11.667401 #19768] ERROR -- : ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection' 
/srv/www/myapp/shared/config/unicorn.conf:31:in `block in reload' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:515:in `call' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:515:in `spawn_missing_workers' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:140:in `start' 
/home/deploy/.bundler/myapp/ruby/1.9.1/gems/unicorn-4.8.2/bin/unicorn_rails:209:in `<top (required)>' 
/home/deploy/.bundler/myapp/ruby/1.9.1/bin/unicorn_rails:23:in `load' 
/home/deploy/.bundler/myapp/ruby/1.9.1/bin/unicorn_rails:23:in `<main>' 

[email protected]:/srv/www/myapp/current# grep -r active_record config/ 
config/environments/test.rb: # config.active_record.schema_format = :sql 
config/initializers/session_store.rb:# MyApp::Application.config.session_store :active_record_store 
config/initializers/devise.rb: # Load and configure the ORM. Supports :active_record (default) and 
config/application.rb:# require "active_record/railtie" 
config/application.rb: # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 

[email protected]:/srv/www/myapp/current# bundle show|grep -E 'unicorn|rails' 

•軌(3.2.11)

•麒麟(4.8.2)

[email protected]:/srv/www/myapp/current# gem -v 

2.1.11 

[email protected]:/srv/www/myapp/current# ruby -v 

ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux] 

回答

0

問題排序。 顯然股票OpsWorks獨角獸食譜有參考ActiveRecord。 所以通過評論/刪除before_fork..end和after_fork..end的整個塊。幫助我們部署使用mongoid的應用程序。

https://github.com/aws/opsworks-cookbooks/blob/master-chef-11.4/unicorn/templates/default/unicorn.conf.erb

我們需要利用襪子文件,而不是在nginx的端口的方法,所以對於我們的應用程序是非常有益的。

還有兩個任務是覆蓋股票獨角獸的默認鍵值,並使用shared/script/unicorn腳本作爲部署用戶自動啓動。

相關問題