Use `cd` instead of `Dir.chdir`.