How to set up ( Fedora php ruby on rails )

Wednesday, June 8, 2011

Encoding::UndefinedConversionError Ruby/Rails

Problem is you opening a binary file and writing it somewhere on other file using ruby/rails


Solution


open file as binary and write it back



File.open(target_file, 'w+b', 0644) do |file|
file.write(destination_file.data)
end

No comments:

Post a Comment