Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6709547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:53:42+00:00 2026-05-26T07:53:42+00:00

I use rails 3.1.1 with ruby-1.9.2-p290 on a debian system through rvm. I use

  • 0

I use rails 3.1.1 with ruby-1.9.2-p290 on a debian system through rvm.
I use swedish letters in my views and in the mysql database.
I keep getting

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

when I visit a page that get’s stuff from the db.

in my database.yml i have this:

staging:
  adapter: mysql
  database:something
  encoding: utf8
  username: something
  password: something
  host: localhost    

production:
  adapter: mysql
  database:something
  encoding: utf8
  username: something
  password: something
  host: localhost

my config.ru:

Encoding.default_external = "UTF-8"
require ::File.expand_path('../config/environment',  __FILE__)
run Someappname::Application

my environment.rb:

# Load the rails application
require File.expand_path('../application', __FILE__)
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
Someappname::Application.initialize!

my config/initializers/encoding.rb:

Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

I have tried with all combinations of “Encoding.default_xxxxxx = Encoding::UTF_8” and without them to

Every controller, helper and mailer starts with:

# encoding: UTF-8

In mysql :

mysql> show variables like ‘char%’;

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

And the output from:

mysql> show variables like ‘colla%’;

+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | utf8_general_ci   |
| collation_server     | latin1_swedish_ci |

Any idea of what I can do? I’m strating to get really tired of this problem!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:53:43+00:00Added an answer on May 26, 2026 at 7:53 am

    Okey, seems that I managed to solve the problem!
    The problem was that I was using mysql and mysql2 at the same time.
    So to solve it, I had to delete mysql and grab the mysql2 “0.3.7” or else devise was throwing strange errors at me.
    And then I had to change the adapter in database.yml to adapter: mysql2

    Hope this helps someone having the same problem!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Ruby on Rails application which is using MySQL database. For now I'm
I need to use Ruby-on-Rails together with a Postgis database. Anyone experience with both
Im using rvm use 1.9.2 then when trying to run rails s I'm getting
when starting Ruby on Rails programming, I will use rails first rails second and
I'm just starting out with Ruby/Rails and am wondering what Rails developers use to
I use both ruby on rails and Java. I really enjoy using migrations when
I use Netbeans (nightly build) for Ruby on Rails development and I'm looking to
In my ruby on rails app I am trying to use a Prototype Form.Element.Observer
Ruby on Rails has a screencast presentation they use to promote their framework that
Is it possible to use single XML file for Ruby on Rails as an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.