Close
add
FileUtils.mkdir_p(File.dirname(sample_path), :mode => 0775)
before the FileUtils.mv in models/post.rb regenerate_sample