Project

General

Profile

Actions

Bug #9156

closed

Not able to get tmp dir to work with Ruby 2.0.0

Bug #9156: Not able to get tmp dir to work with Ruby 2.0.0

Added by saipas (B L) almost 12 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby-2.0.0-p353
Backport:
[ruby-core:58575]

Description

I just migrated to Ruby 2.0.0 from 1.9.2 and I'm getting errors when trying to handle files because I can't get tmp directories to work.

If you check this file and look at line 29 you'll see that a check on world_writable? has been added, but the file should not be world writable (prepended by !). So tmp dir are now restricted? What should I do to set up my machine? (I'm using Rails 4)

Here's the error I get:

ArgumentError: could not find a temporary directory
When I try to hit Dir:tmpdir

/home/ben/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tmpdir.rb: in tmpdir
raise ArgumentError, "could not find a temporary directory" if !tmp

Thanks
Ben

Updated by nobu (Nobuyoshi Nakada) almost 12 years ago Actions #1 [ruby-core:58586]

  • Status changed from Open to Feedback

It's by a security reason.
What's your platform?

Updated by saipas (B L) over 11 years ago Actions #2 [ruby-core:60646]

Sorry for the delayed answer, my platform is OSX Mavericks.

Updated by nobu (Nobuyoshi Nakada) over 11 years ago Actions #3 [ruby-core:60662]

MacOS X makes a directory with permission 0700 under /var/folders and sets TMPDIR to it by default.
Check if it is properly set: ls -ld "$TMPDIR"

Updated by saipas (B L) over 11 years ago Actions #4 [ruby-core:60756]

That's what I get:
drwx------ 181 ben staff 6154 Feb 15 00:07 /var/folders/w6/5t5wbvps7sq68h0ss0qs3ygm0000gn/T/

Updated by jeremyevans0 (Jeremy Evans) about 6 years ago Actions #5

  • Status changed from Feedback to Closed
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Actions

Also available in: PDF Atom