I want to write something to a file.
# where userid is any intger [sic]
path = Rails.root + \"public/system/users/#{user.id}/style/img.jpg\"
File.open(path,
Trying to use gets inside a rake task? You may be seeing this error message:
Errno::ENOENT: No such file or directory @ rb_sysopen
Did you try searching the error, and end up on this page? This answer is not for the OP, but for you.
Use STDIN.gets. Problem solved. That's because just using gets resolves back to $stdin.gets and rake is overriding the global variable so that gets tries to open a file handle that doesn't exist. Here's why:
What's the difference between gets.chomp() vs. STDIN.gets.chomp()?