What is the best way to get an empty temporary directory in Ruby on Rails?

The Dir object has a method mktmpdir which creates a temporary directory:

require 'tmpdir' # Not needed if you are using rails.

Dir.mktmpdir do |dir|
  puts "My new temp dir: #{dir}"
end

The temporary directory will be removed after execution of the block.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)