it's because the following cmd won't generate stemcell.MF into dir as I expected. The -C option seems to be ignored.

tar -xzf #{file_path} stemcell.MF -C #{dir}