我想使用Capistrano的部署,但是当我做帽部署:更新它不是创建一个/当前文件夹,这里的错误,任何想法?
executing "cd /home/adamtodd/apps/homebase/current && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile --trace"
servers: ["xx.xxx.xx.xxx"]
[xx.xxx.xx.xxx] executing command
** [out :: xx.xxx.xx.xxx] bash: line 0: cd: /home/adamtodd/apps/homebase/current: No such file or directory
我有同样的问题,当我用资产预编译柯蒂斯溶液( 资产:预编译任务redifinition )上首次部署(部署:感冒没有帮助我)
简单的解决方法在这里
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
begin
from = source.next_revision(current_revision) # <-- Fail here at first-time deploy because of current/REVISION absence
rescue
err_no = true
end
if err_no || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
end
end
cap deploy:update
一般只对已经部署的其中一次我假设你的情况并没有发生,因为你没有一个应用程序的工作current
目录。
试着做一个cap deploy:cold
代替。
它看起来就像你重新定义了部署:资产:预编译的任务,因为在Capistrano的源代码,你可以看到它试图cd到releases/12345
,没有current
:
https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb#L31-43
所以,我会检查你的deploy.rb并取出重新定义任务。
(我已经重新定义了任务,以同样的方式,甚至加入了--trace
喜欢你,但无论问题我试图解决的是没有问题的任何更多的,和出的现成的任务对我来说工作正常如果我猜的话,我会说,我们的自定义任务是黑客获得RAILS_GROUPS=assets
进入命令字符串,但Capistrano的自动处理,现在,你可以看到,如果您检查链接的源代码。)