一直在与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