2012-07-27 181 views
1

我試圖設置我的Ruby on Rails應用程序以部署到精簡集羣。當我手動啓動服務器上的瘦羣集使用bundle exec thin start -C config/thin.yml一切工作正常。然而,當我通過Capistrano的運行相同的命令,它只是死了,日誌顯示:Thin/Capistrano無法連接到數據庫

/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)

我不知所措,我登錄到使用相同的用戶帳戶在Capistrano的腳本中定義的服務器。

我Capistrano的薄任務:

namespace :deploy do 
    task :start do 
     run "cd #{current_path}; bundle exec thin start -C config/thin.yml" 
    end 
    task :stop do 
     run "cd #{current_path}; bundle exec thin stop -C config/thin.yml" 
    end 
    task :restart do 
     run "cd #{current_path}; bundle exec thin restart -C config/thin.yml" 
    end 
    end 

這裏是我的thin.yml:

--- 
chdir: /var/www/rails/myapp/current 
environment: staging 
address: 0.0.0.0 
port: 3000 
timeout: 30 
log: log/thin.log 
pid: tmp/pids/thin.pid 
max_conns: 1024 
max_persistent_conns: 512 
require: [] 
wait: 30 
servers: 2 
daemonize: true 

任何幫助,將不勝感激

回答