I am upgrading a rails project from version 2. A formal developper made functions which allows any file type to be placed into a database field as a .gz archive. They are presented in the gist: http://ift.tt/18OJzyG .
If I run it as it is, I get "\xFF" from ASCII-8BIT to UTF-8 error. As I searched on stackoverflow, some solutions suggested wb and rb modes. Doing that will make the unix command gzip fail due to the fact that the archive is not of gzip format, even though they are suffixed with .gz(line 8 on gist). I have also tried using the compressed package which returns the same result as above.
As a sidenote, the contents database field is of type mediumtext latin1_swedish_ci. Currently, rails version is 3.2.0 and ruby version is ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
What should my next approach be?
Aucun commentaire:
Enregistrer un commentaire