DigitalOcean VPS上的Capistrano检查失败

时间:2013-09-11 16:43:05

标签: node.js capistrano

我正在尝试将Node.js应用程序部署到运行在DigitalOcean上的VPS,到目前为止,我已经很好了。到目前为止。我对* nix的理解非常有限,所以请耐心等待我:)

我可以使用SSH密钥以root身份进入我的VPS(Ubuntu 13.04 x32),没有任何问题。当我在本地计算机上运行“$ cap deploy:setup”时,我得到了这个结果:

  * 2013-09-11 12:39:08 executing `deploy:setup'
  * executing "mkdir -p /var/www/yable /var/www/yable/releases /var/www/yable/shared /var/www/yable/shared/system /var/www/yable/shared/log /var/www/yable/shared/pids"
    servers: ["162.243.1.207"]
    [162.243.1.207] executing command
 ** [out :: 162.243.1.207] env: sh: No such file or directory
    command finished in 118ms
failed: "env PATH=/var/www/yable NODE_ENV=production sh -c 'mkdir -p /var/www/yable /var/www/yable/releases /var/www/yable/shared /var/www/yable/shared/system /var/www/yable/shared/log /var/www/yable/shared/pids'" on 162.243.1.207

当我运行“$ cap deploy:check”时,我得到以下输出:

* 2013-09-11 12:40:36 executing `deploy:check'
  * executing "test -d /var/www/yable/releases"
    servers: ["162.243.1.207"]
    [162.243.1.207] executing command
    command finished in 67ms
  * executing "test -w /var/www/yable"
    servers: ["162.243.1.207"]
    [162.243.1.207] executing command
    command finished in 76ms
  * executing "test -w /var/www/yable/releases"
    servers: ["162.243.1.207"]
    [162.243.1.207] executing command
    command finished in 69ms
  * executing "which git"
    servers: ["162.243.1.207"]
    [162.243.1.207] executing command
    command finished in 75ms
The following dependencies failed. Please check them and try again:
--> `/var/www/yable/releases' does not exist. Please run `cap deploy:setup'. (162.243.1.207)
--> You do not have permissions to write to `/var/www/yable'. (162.243.1.207)
--> You do not have permissions to write to `/var/www/yable/releases'. (162.243.1.207)
--> `git' could not be found in the path (162.243.1.207)

这是我的config / deploy.rb文件:

set :application, "Yable.com"
set :scm, :git
set :repository, "git@github.com:Yable/yable-node-js.git"
set :user, "root"
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true
set :use_sudo, false
set :branch, "master"

role :app, "162.243.1.207"
set :deploy_to, "/var/www/yable"

set :default_environment, {
  'PATH' => "/var/www/yable",
  'NODE_ENV' => 'production'
}

我傻眼了,因为提到的目录(/ var / www / yable / releases)确实存在并且已经安装了git。有什么想法吗?

谢谢, 弗朗西斯

1 个答案:

答案 0 :(得分:0)

我安装了ruby 2.0.0和Bundler,它似乎解决了我的部署问题。