ここで明らかな何かが欠けているに違いありませんが、次のコードを機能させることができないようです。
xml_files_dir.each do | xml_file |
file = File.new ( xml_files_dir + "/" + xml_file )
puts File.file? file #true. so I know the file was created and is a file
doc = REXML::Document.new file #error
end
私が得るものは:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/source.rb:146:in `read':ディレクトリです-/ Path / To / My / XML / File /。(Errno :: EISDIR)
有効なファイルのように見えるのに、REXMLが私のファイルをディレクトリと見なすのはなぜですか?
ありがとう