我想将目录复制到另一个目录。(如果存在,覆盖)所以在我的循环中,,,
FileUtils.cp_r(src, dst, :remove_destination => true)
但我遇到了错误
/home/deployer/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1550:in `block in fu_each_src_dest': same file: 273 and /todpop/todpop_data/word/image/273 (ArgumentError)
from /home/deployer/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1565:in `fu_each_src_dest0'
from /home/deployer/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:1549:in `fu_each_src_dest'
from /home/deployer/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/fileutils.rb:434:in `cp_r'
from copy.rb:16:in `block (2 levels) in <main>'
from copy.rb:15:in `each'
from copy.rb:15:in `block in <main>'
from copy.rb:8:in `each'
from copy.rb:8:in `<main>'
为什么尽管设置了 :remove_destination 仍会发生此错误?T^T