Welcome to the forum, cglism.
Using the Ruby standard libraries via "require" and Gems does not work as standard Ruby in FlowStone, unfortunately.
The first difference is that the FS installation does not include the standard libraries. However, from the error message, I am guessing that you already modified $LOAD_PATH to fix this.
The second difference is that libraries cannot be used which include compiled C++ extensions, only those which are coded using pure Ruby. But I don't think this is the problem - the FileUtils source code is Ruby and I can't see any other "requires" in the code.
The third difference is that the Encoding class for Strings only allows ASCII Strings. None of the UTF encodings are available - and this is what the error message is saying. So it seems that either the FileUtils source file is UTF encoded, or that within the FileUtils methods, some String encoding conversions are used.
Unfortunately, because Encoding is a "core" class compiled into FlowStone's custom Ruby interpreter, there is nothing that can be done to change this.
The easiest alternative would be to use the
xcopy or
robocopy commands of the Windows cmd shell via the Ruby
system method. That would look something like this...
- Code: Select all
# NB: source and destination are wrapped in quotes to allow space characters in the paths.
system("robocopy \"#{source}\" \"#{destination}\" /e")