サーバーと開発マシンの間で自動デプロイを行うために Capistrano をいじっています。カピストラーノが bundle exec コマンドを使用してサーバーを起動できないように見えることを除いて、ほぼ設定済みです。私は常に次のエラーを受け取ります:
編集: 構成ファイルは現在 /var/www/apps/current/thin.yml にあります
...
* 「sudo -p 'sudo password: ' bundle exec thin start -C /var/www/thin.config.yml」を実行
サーバー: ["85.255.206.157"]
[85.255.206.157] コマンドの実行
** [out :: 85.255.206.157] Gemfile が見つかりませんでした
コマンドは 216ms で終了しました
失敗しました: "sh -c 'sudo -p '\\''sudo パスワード: '\\'' bundle exec thin start -C /var/www/thin.config.yml'" on 85.255.206.157
関連する最後のセクションのみをコピーしました。ファイルなどの全体のコピーは正常に機能します。失敗しているように見えるクラスターを開始しているだけです。すべての Capistrano を処理する deploy.rb ファイルは次のとおりです。
編集: ファイルは次のように変更されました。
require "bundler/capistrano"
# define the application and Version Control settings
set :application, "ESCO Matching Demo"
set :repository, "svn://192.168.33.70/RubyOnRails/ESCO"
set :deploy_via, :copy
# Set the login credentials for Capistrano
set :user, "kurt"
# Tell Capistrano where to deploy
set :deploy_to, "/var/www/apps"
# Tell Capistrano the servers it can play with
server "85.255.206.157", :app, :web, :db, :primary => true
# Generate an additional task to fire up the thin clusters
namespace :deploy do
desc "Start the Thin processes"
task :start do
sudo "bundle exec thin start -C thin.yml"
end
desc "Stop the Thin processes"
task :stop do
sudo "bundle exec thin stop -C thin.yml"
end
desc "Restart the Thin processes"
task :restart do
sudo "bundle exec thin restart -C thin.yml"
end
desc "Create a symlink from the public/cvs folder to the shared/system/cvs folder"
task :update_cv_assets, :except => {:no_release => true} do
run "ln -s #{shared_path}/cvs #{latest_release}/public/cvs"
end
end
# Define all the tasks that need to be running manually after Capistrano is finished.
after "deploy:finalize_update", "deploy:update_cv_assets"
after "deploy", "deploy:migrate"
編集:これは私の thin.yml ファイルです
---
pid: tmp/pids/thin.pid
address: 0.0.0.0
timeout: 30
wait: 30
port: 4000
log: log/thin.log
max_conns: 1024
require: []
environment: production
max_persistent_conns: 512
server: 4
daemonize: true
chdir: /var/www/apps/current
編集: 現在、次の問題が発生しています。
最終ステップでシステムから cap deploy コマンドを実行すると、「GemFile が見つかりません」というエラーが表示されます: サーバーの起動
移行は実行されません
クラスターを手動で起動することもできなくなったようです。シンの 1 つのインスタンスのみが起動しています。
更新: これは、デプロイ先のサーバーの gem 環境設定です。この情報は、cap シェルを使用して次のコマンドを実行することによって取得されます。
================================================== ================== インタラクティブな Capistrano シェルへようこそ! これは実験的なものです 機能であり、将来のリリースで変更される可能性があります。「ヘルプ」と入力してください シェルの使い方のまとめ。 -------------------------------------------------- ------------------ cap> echo $PATH [85.255.206.157 への接続を確立しています] パスワード: ** [out :: 85.255.206.157] /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games cap> gem env ** [out :: 85.255.206.157] RubyGems 環境: ** [out :: 85.255.206.157] - RUBYGEMS バージョン: 1.3.6 ** [out :: 85.255.206.157] - ルビー バージョン: 1.8.7 (2010-01-10 パッチレベル 249) [x86_64-linux] ** [out :: 85.255.206.157] - インストールディレクトリ: /usr/lib/ruby/gems/1.8 ** [out :: 85.255.206.157] - ルビー実行可能: /usr/bin/ruby1.8 ** [out :: 85.255.206.157] - 実行可能ディレクトリ: /usr/bin ** [out :: 85.255.206.157] - RUBYGEMS プラットフォーム: ** [out :: 85.255.206.157] - ルビー ** [出力 :: 85.255.206.157] - x86_64-linux ** [out :: 85.255.206.157] - GEM パス: ** [アウト :: 85.255.206.157] - /usr/lib/ruby/gems/1.8 ** [アウト :: 85.255.206.157] - /home/kurt/.gem/ruby/1.8 ** [out :: 85.255.206.157] - GEM 設定: ** [アウト :: 85.255.206.157] - :update_sources => true ** [out :: 85.255.206.157] - :verbose => true ** [out :: 85.255.206.157] - :benchmark => false ** [out :: 85.255.206.157] - :backtrace => false ** [アウト :: 85.255.206.157] - :bulk_threshold => 1000 ** [out :: 85.255.206.157] - リモート ソース: ** [アウト :: 85.255.206.157] - http://rubygems.org/