I tried to copy a file from my desktop to another folder with this code:
FileUtils.cp('image.png', '/folder/image.png')
I got this error:
NameError: uninitialized constant FileUtils
Did you mean? FileTest
I am trying to work out why I got the error.
FileUtils
must be explicitly require
d:
require 'fileutils'
FileUtils.cp('image.png', '/folder/image.png')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With