Filipin.eu

Željko Filipin's blog.
Home Blog Tags License

View on GitHub
12 September 2007

NoMethodError: undefined method `copy' for File:Class

by Željko Filipin

tags: code · ruby

Estimated reading time is 1 minute.

I wanted to copy a file from Ruby. Documentation for File#copy said that

File.copy(from, to)

should work. But, I got this error message:

NoMethodError: undefined method `copy' for File:Class

Google search led me to ruby-talk post that said I should do:

require "ftools"

I am just surprised that documentation did not make that clear.

Feedback

Thank you for reading. If you want to stay in touch please use the feed or send me an email.