incompatible character encodings: UTF-8 and ASCII-8BIT

Just got the following error in my Rails project (Rails 3.2.6, Ruby 1.9.3):

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT)

That was caused by the case when MySQL record (ActiveReciord object, actually) contained UTF-8 characters and i was trying to output those chars in my template. But mysql gem does not support those. It needs some hacking.

Luckily, there is more convenient way to solve the problem. The solution of this issue now appears too easy:

  • Install the mysql2 gem
  • Use adapter: mysql2 instead of adapter: mysql in your config/database.yml file

My coursework. Two months later

My coursework: two months later. No, i was not doing all that stuff for two months - iโ€ฆ โ€œfreezedโ€ the project for that time ๐Ÿ˜œ Actually, the greatest portion of job was done in one day - 22.04.2012 .. 23.04.2012 ๐Ÿ˜

My coursework becomes a bit more interesting

My coursework becomes a bit more interesting ๐Ÿ˜