Encoding problems in rails on ruby 1.9.1

后端 未结 3 1672
一生所求
一生所求 2021-02-15 02:29

I am using rails 2.3.3 and ruby 1.9.1.

I am trying to render a view that includes a partial. In the partial i output a field of a model that is encoded in UTF8. This fai

3条回答
  •  逝去的感伤
    2021-02-15 03:27

    There seems to be an incompatibility between Ruby 1.9x and the mysql gem with regard to how strings are passed back and forth (specifically the encoding of the strings).

    To fix, run

    gem install mysql2 
    

    on the server and update the database configuration file to use this gem instead of the previous one.

提交回复
热议问题