没有这样的文件或目录(public / assets / manifest *)

时间:2014-01-17 07:14:17

标签: ruby-on-rails amazon-web-services amazon-ec2 capistrano manifest

在使用capistrano v3进行部署(3.2.16v)期间,我收到以下错误。

$ cap development deploy --trace

DEBUG [014a40e4] Running /usr/bin/env [ -L /home/ec2-user/capistrano-3/my_app/releases/20140117124107/public/assets ] on 50.13.220.55
DEBUG [014a40e4] Command: [ -L /home/ec2-user/capistrano-3/my_app/releases/20140117124107/public/assets ]
DEBUG [014a40e4] Finished in 0.602 seconds with exit status 1 (failed).
DEBUG [9c5901ab] Running /usr/bin/env [ -d /home/ec2-user/capistrano-3/my_app/releases/20140117124107/public/assets ] on 50.13.220.55
DEBUG [9c5901ab] Command: [ -d /home/ec2-user/capistrano-3/my_app/releases/20140117124107/public/assets ]
DEBUG [9c5901ab] Finished in 0.639 seconds with exit status 1 (failed).

////此错误位于跟踪结束

**调用deploy:assets:backup_manifest(first_time)

**执行deploy:assets:backup_manifest

DEBUG [a08f4c02]    cp: 
DEBUG [a08f4c02]    cannot stat `/home/ec2-user/capistrano-3/my_app/releases/20140117064709/public/assets/manifest*'
DEBUG [a08f4c02]    : No such file or directory
DEBUG [a08f4c02]    
cap aborted!
cp stdout: Nothing written
cp stderr: Nothing written

Tasks: TOP => deploy:assets:backup_manifest
The deploy has failed with an error: #<SSHKit::Command::Failed: cp stdout: Nothing written
cp stderr: Nothing written
>
** Invoke deploy:failed (first_time)
** Execute deploy:failed

我的本​​地计算机上也没有任何资源文件夹。任何人都可以帮助我吗?

4 个答案:

答案 0 :(得分:18)

sprockets 3.0.x和capistrano-rails会发生这种情况,并且似乎已经修复了capistrano-rails 1.1.3。

如果你的Gemfile有gem 'capistrano-rails', '~> 1.1'(按照安装指南中的建议),只需输入bundle update capistrano-rails即可升级。

请参阅https://github.com/capistrano/rails/blob/master/CHANGELOG.md#113-apr-18-2015https://github.com/capistrano/rails/issues/111

答案 1 :(得分:13)

尝试:

touch /home/ec2-user/capistrano-3/my_app/releases/20140117064709/public/assets/manifest

我认为之前错误配置的cap <env> deploy已经搞砸了作品,现在你永远注定了。简单地touch清单文件,将允许任务deploy:assets:backup_manifest继续执行它的事情,因为它期望先前的构建清单文件在那里进行清理。所以,给它一些清洁的东西。无论如何,这解决了我的问题。

tl;dr;制作垃圾,随便乱扔垃圾,某人,某个地方会在你之后清理,在这种情况下,一个以前的预编译垃圾是assets_manifest_backup的宝藏。

我还对服务器进行了测试,确保RAILS_ENV=production bundle工作正常,并且必须为私有git repo解析一些ssh部署密钥。这可能是口香糖,使我的作品变得粗糙。

答案 2 :(得分:5)

添加到Gemfile gem 'sprockets', '2.12.3'

答案 3 :(得分:0)

您是否在预编制资产?也许在部署之前预先编译你的资产会有所帮助。