How to create a file in Ruby

后端 未结 9 1226
再見小時候
再見小時候 2020-11-28 18:04

I\'m trying to create a new file and things don\'t seem to be working as I expect them too. Here\'s what I\'ve tried:

File.new \"out.txt\"
File.open \"out.tx         


        
9条回答
  •  有刺的猬
    2020-11-28 18:58

    The directory doesn't exist. Make sure it exists as open won't create those dirs for you.

    I ran into this myself a while back.

提交回复
热议问题