Ubuntu 10.04 Rails部署 - 为什么capistrano无法部署到服务器?

时间:2013-02-16 17:16:43

标签: ruby capistrano

我正在尝试使用capistrano进行部署。 RVM安装在服务器上,ruby版本为1.93p385。

以下是上限生产部署的日志:

http://pastie.org/private/vs336nrgejpwdkuelufnma#

为什么capistrano未能部署?

这是部署文件:

require "rvm/capistrano"
require "bundler/capistrano"
set :rvm_ruby_string, "1.9.3-p385"
set :rvm_type, :user #Should the user by the username?
require "capistrano/ext/multistage"

set :http_server, :apache2
set :rake, "#{rake} --trace"
set :application, "app"
set :user,        "myuser" # The server's user for deploys

set :ruby_version, "1.9.3-p385"

set :scm,         "git"
set :repository,  "my git repo here"

set :deploy_to,   "/var/www/#{application}"
set :deploy_via,  :remote_cache

set :use_sudo,    true

default_run_options[:pty]   = true # Must be set for the password prompt from git to work
ssh_options[:forward_agent] = true

set :nodejs, true

# if you want to clean up old releases on each deploy uncomment this:
after "deploy:restart", "deploy:cleanup"

服务器是Ubuntu 10.04 LTS

2 个答案:

答案 0 :(得分:1)

** [out :: server] No such file or directory - /var/www/app/releases/20130216170229/config/database.yml

服务器上是否存在此路径?您可能需要手动创建/var/www/app/releases部分,然后将capistrano部署到。{/ p>

答案 1 :(得分:0)

这是.gitignore database.yml用于capistrano部署的常见模式。然后数据库配置驻留在<:deploy_to>/shared/config/中。您使用此上限任务来对发布目录中的db config进行符号链接:

namespace :deploy do
  task :start do ; end
  task :stop do ; end

  desc "Symlink shared folders on each deployment"
    task :symlink_shared do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end
end

before "deploy:assets:precompile", "deploy:symlink_shared"
相关问题