method
tmpdir
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
Register or
log in
to add new notes.
mcmire -
October 31, 2009
![Default_avatar_30](https://www.gravatar.com/avatar/e9e852b18079792bc5f4ec52b8e37c53?default=http://apidock.com/images/default_avatar_30.png&size=30)
2 thanks
Don't forget to require 'tmpdir'
If you simply say Dir.tmpdir you might get a nice surprise:
irb> Dir.tmpdir NoMethodError: undefined method `tmpdir' for Dir:Class
from (irb):1
Strangely, this method seems to be stored in a file that Ruby doesn’t require by default. Just require 'tmpdir' and all should be well.
irb> require 'tmpdir' => true irb> Dir.tmpdir => "/var/folders/An/AnwlXPZFH2aRLCERERQDKE+++TI/-Tmp-"