2014-02-11 17 views
3

我升级从Capistrano的2至3 Capistrano的,一切似乎除了我看到当它运行这两个未能成功运行:Capistrano的3个过程失败

DEBUG [bbfe01ec] Running /usr/bin/env [ -L /var/www/myapp/releases/20140211033611/public/assets ] on myapp.com 
DEBUG [bbfe01ec] Command: [ -L /var/www/myapp/releases/20140211033611/public/assets ] 
DEBUG [bbfe01ec] Finished in 0.146 seconds with exit status 1 (failed). 
DEBUG [26f99b11] Running /usr/bin/env [ -d /var/www/myapp/releases/20140211033611/public/assets ] on myapp.com 
DEBUG [26f99b11] Command: [ -d /var/www/myapp/releases/20140211033611/public/assets ] 
DEBUG [26f99b11] Finished in 0.141 seconds with exit status 1 (failed). 

为什么这些失败,怎么能我修理它们?

回答

2

我有同样的问题,这里是Capistrano的代码,实现当你收到这些错误:

desc 'Symlink linked directories' 
    task :linked_dirs do 
    next unless any? :linked_dirs 
    on release_roles :all do 
     execute :mkdir, '-pv', linked_dir_parents(release_path) 

     fetch(:linked_dirs).each do |dir| 
     target = release_path.join(dir) 
     source = shared_path.join(dir) 
     unless test "[ -L #{target} ]" 
      if test "[ -d #{target} ]" 
      execute :rm, '-rf', target 
      end 
      execute :ln, '-s', source, target 
     end 
     end 
    end 
    end 

至于我能理解这是一个使用命令ln创建符号链接。

关于ln(man ln)的阅读手册我们知道,在尝试制作硬链接目录时,命令可能因系统限制而失败。

-d, -F, --directory 
    allow the superuser to attempt to hard link directories (note: will probably fail 
    due to system restrictions, even for the superuser) 

“LN -d”未能创建硬链接,这就是为什么以创建符号链接(符号链接而不是硬链接)执行“LN -s”。

所以,不用担心这个失败。如果你想避免它只是改变你这样的部署选项:

set :format, :pretty 
set :log_level, :info 
+1

你是怎么知道'在/ usr/bin中/ ENV [-L /无功/网络/ MYAPP /发行/ 20140211033611 /大众/资产]'试图创建一个链接?我之前在linux中使用过'ln',但不知道这个命令甚至试图做什么。 – Catfish

+0

谢谢,我有和你一样的错误,只是想着'部署流程'通过capistrano代码(http://capistranorb.com/documentation/getting-started/flow/)。它可以帮助我确定发生故障的位置 –