This always fails.

Dir.chroot(Dir.pwd)
Kernel.system('echo "new file" > foo')
Kernel.system('rm -f bar')
Kernel.system('mv -f foo bar')
if File.exists?("bar") == true then puts "PASS" else puts "FAIL" end

It's the chroot which is causing the problem.  What's the problem?