Skip to content

Instantly share code, notes, and snippets.

@kml
Created December 13, 2016 22:56
Show Gist options
  • Save kml/592e73090cc91fd5e07a2a7e3f9aed93 to your computer and use it in GitHub Desktop.
Save kml/592e73090cc91fd5e07a2a7e3f9aed93 to your computer and use it in GitHub Desktop.
# encoding: utf-8
# ISSUE: https://github.com/jruby/jruby/issues/405
# In JRuby, FileUtils.remove_entry_secure(dir) crashes when a dir is under
# a world-writable directory because it tries to open directory.
# Opening directory is not allowed in Java.
# -- https://github.com/jruby/jruby/blob/1.7.0/lib/ruby/1.9/tmpdir.rb#L25-L28
#[1] pry(main)> Dir.tmpdir
#=> "/home/capistrano/application/releases/20161115100828"
ENV["TMPDIR"] = Rails.root.join("tmp").to_s
#[3] pry(main)> Dir.tmpdir
#=> "/home/capistrano/application/releases/20161115100828/tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment