2012-07-27 184 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 

任何帮助,将不胜感激

回答