【问题标题】:Capistrano check fails on DigitalOcean VPSCapistrano 检查在 DigitalOcean VPS 上失败
【发布时间】:2013-09-15 19:27:36
【问题描述】:

我正在尝试将 Node.js 应用程序部署到在 DigitalOcean 上运行的 VPS 上,到目前为止,我的情况正在好转……非常远。我对 *nix 的理解非常有限,请多多包涵:)

我可以使用我的 SSH 密钥以 root 身份 ssh 进入我的 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 时,我傻眼了。有什么想法吗?

谢谢, 弗朗西斯

【问题讨论】:

    标签: node.js capistrano


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-12-03
      • 2013-10-23
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 2012-08-06
      • 2013-04-25
      • 1970-01-01
      • 2020-01-30
      相关资源
      最近更新 更多