Ruby on Rails アプリケーションをセットアップして、シン クラスターにデプロイしようとしています。サーバー上でシン クラスターを手動で起動すると、bundle exec thin start -C config/thin.yml
すべて正常に動作します。ただし、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 スクリプトで定義されているのと同じユーザー アカウントを使用してサーバーにログインします。
マイ カピストラーノ シン タスク:
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
どんな助けでもいただければ幸いです