I've been struggling with the same issue a few times, and the solution
that worked for me was to use a different mysql driver: ruby-mysql

# in config/environment.rb:
config.gem 'ruby-mysql'

# or in Gemfile:
gem 'ruby-mysql'

The encoding must also be set in config/database.yml:
 adapter: mysql
 encoding: utf8

On Mon, Mar 29, 2010 at 2:21 PM, Heinz Strunk <[email protected]> wrote:
> Hello,
>
> I just tried to migrate one of my applications from ruby 1.8 to ruby 1.9
> and get following error:
>  Showing app/views/layouts/application.html.erb where line #48  raised:
>  incompatible character encodings: ASCII-8BIT and UTF-8
>
>  48:     <%= render :partial => 'layouts/menu' %>
>
> I added "<%# coding: utf-8 %>" in application.html.erb and
> layouts/_menu.rhtml but it still throws that error, anyone knows why?
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to