一直在與Capistrano玩耍,以獲得我的服務器和我的開發機器之間的自動部署。除了Capistrano似乎無法使用bundle exec命令啓動我的服務器外,我幾乎已經配置了它。我總是收到以下錯誤:Capistrano部署瘦服務器
編輯:配置文件現在居住在/var/www/apps/current/thin.yml
... * executing "sudo -p 'sudo password: ' bundle exec thin start -C /var/www/thin.config.yml" servers: ["85.255.206.157"] [85.255.206.157] executing command ** [out :: 85.255.206.157] Could not locate Gemfile command finished in 216ms failed: "sh -c 'sudo -p '\\''sudo password: '\\'' 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
編輯:現在 以下問題發生:
我收到了找不到的Gemfile錯誤從我的系統上的最後一個步驟運行帽部署命令時:
遷移不進行服務器的啓動
我可以」 t似乎已經手動啓動羣集了。只有一個瘦身實例正在啓動。
UPDATE: 這裏是我部署到服務器上的寶石ENV設置。該信息是通過使用帽殼,然後運行命令獲得:
==================================================================== Welcome to the interactive Capistrano shell! This is an experimental feature, and is liable to change in future releases. Type 'help' for a summary of how to use the shell. -------------------------------------------------------------------- cap> echo $PATH [establishing connection(s) to 85.255.206.157] Password: ** [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 Environment: ** [out :: 85.255.206.157] - RUBYGEMS VERSION: 1.3.6 ** [out :: 85.255.206.157] - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] ** [out :: 85.255.206.157] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 ** [out :: 85.255.206.157] - RUBY EXECUTABLE: /usr/bin/ruby1.8 ** [out :: 85.255.206.157] - EXECUTABLE DIRECTORY: /usr/bin ** [out :: 85.255.206.157] - RUBYGEMS PLATFORMS: ** [out :: 85.255.206.157] - ruby ** [out :: 85.255.206.157] - x86_64-linux ** [out :: 85.255.206.157] - GEM PATHS: ** [out :: 85.255.206.157] - /usr/lib/ruby/gems/1.8 ** [out :: 85.255.206.157] - /home/kurt/.gem/ruby/1.8 ** [out :: 85.255.206.157] - GEM CONFIGURATION: ** [out :: 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 ** [out :: 85.255.206.157] - :bulk_threshold => 1000 ** [out :: 85.255.206.157] - REMOTE SOURCES: ** [out :: 85.255.206.157] - http://rubygems.org/
也許它的確定只是做這樣的'運行「CD#{的current_path} &&捆綁高管薄啓動-C薄.yml「' – Shtirlic 2012-02-21 13:20:00
可以讓它在下一個項目上旋轉,可能會使命令更具可讀性。 – 2012-02-21 13:40:39