【问题标题】:capistrano: cp - cannot statcapistrano: cp - 无法统计
【发布时间】:2016-08-20 07:32:15
【问题描述】:

我正在尝试部署 errbit (https://github.com/errbit/errbit),但无法让 capistrano 编译远程服务器上的资产。 似乎它在创建清单路径时无缘无故地添加了一些乱码,我真的不知道在哪里可以修复它......

这是 Capistrano 的输出

  01 /usr/local/rvm/bin/rvm 2.3.0 do bundle exec rake assets:precompile
  01 Notice: no rspec tasks available in this environment
  01 Overwriting existing field _id in class App.
  01 Creating scope :page. Overwriting existing method NotificationServices…
✔ 01 deployer@000.000.000.000 2.336s
  00:22 deploy:assets:backup_manifest
  01 mkdir -p /home/deployer/apps/errbit/releases/20160426123255/assets_man…
  01
✔ 01 deployer@000.000.000.000 0.330s /home/deployer/apps/errbit/releases/20160…
  02
  02 cp: cannot stat ‘\033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home...
  02 : No such file or directory
  (Backtrace restricted to imported tasks)
  cap aborted!
  SSHKit::Runner::ExecuteError: Exception while executing as deployer@000.000.000.000: cp exit status: 1
  cp: cannot stat ‘\033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home/deployer/apps/errbit/releases/20160426123255/public/assets/.sprockets-manifest-cd1becb3ebe39b1efd086cd82910b5dd.json’: No such file or directory
  cp stderr: Nothing written

  SSHKit::Command::Failed: cp exit status: 1
  cp: cannot stat ‘\033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home/deployer/apps/errbit/releases/20160426123255/public/assets/.sprockets-manifest-cd1becb3ebe39b1efd086cd82910b5dd.json’: No such file or directory
  cp stderr: Nothing written

  Tasks: TOP => deploy:assets:backup_manifest
  (See full trace by running task with --trace)
  The deploy has failed with an error: Exception while executing as deployer@000.000.000.000: cp exit status: 1
  cp: cannot stat ‘\033[?25h\033[0G\033[K\033[?25h\033[0G\033[K/home/deployer/apps/errbit/releases/20160426123255/public/assets/.sprockets-manifest-cd1becb3ebe39b1efd086cd82910b5dd.json’: No such file or directory
  cp stderr: Nothing written

正如您在 /home/deployer 之前看到的,有一些我无法理解的随机字符。

我认为唯一可以做的地方是 deploy_to 指令:

set :deploy_to, '/home/deployer/apps/errbit'

这是我的 Gemfile.lock

https://gist.github.com/ngw/1157a005ff7f6077b9f5b232b0371a76

我在这里看不到问题。

有人可以帮我吗?

【问题讨论】:

  • 你用nvm之类的东西,你能用隐藏文件显示主文件夹~/的内容吗?
  • ‘\033[?25h\033[0G\033[K\033[?25h\033[0G\033[K 是 bash 控制代码,你在 env vars 中使用过颜色吗?
  • 我正在使用 rvm,我添加的唯一文件是 .ruby-version 和 .ruby-gemset 似乎工作得很好。它们的内容是“2.3.0”和gemset的名称。
  • @МалъСкрылевъ 也许,我认为这都是关于 bash 登录的,看起来远程 shell 尝试做某事并因错误重定向而失败。我有同样的问题,它是节点版本管理器和 .nvmrc 文件。
  • 确保目录/home/deployer/apps/errbit 存在于您要部署到的服务器上

标签: ruby-on-rails capistrano sprockets errbit


【解决方案1】:

为我修复:
bundle update capistrano
在 deploy.rb 中更改
set :pty, true

set :pty, false

【讨论】:

    猜你喜欢
    • 2022-09-29
    • 1970-01-01
    • 2022-07-06
    • 2021-12-27
    • 2016-04-11
    • 2017-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多