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 3691364
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:08:23+00:00 2026-05-19T04:08:23+00:00

I upgraded to RoR 3.0.1 and Ruby to 1.9.2. Now all the strings in

  • 0

I upgraded to RoR 3.0.1 and Ruby to 1.9.2. Now all the strings in my views are ASCII-8BIT?

I believe I have my app set up to use UTF 8

application.rb

config.encoding = "utf-8"

database.yml

development:
  adapter: mysql
  encoding: utf8

I’m running

OS X
RVM rvm 1.0.16 
Ruby ruby-1.9.2-p0
Rails 3.0.1

I’d expect that the enoding would be UTF 8 not ASCII

business.desc.encoding
# ASCII-8BIT

Since 1.9.x can concatenate strings of different encodings we see a lot of errors like this.

<p class="description"><%= truncate(business.desc, :length => 17) %></p>

The Error

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

activesupport (3.0.1) lib/active_support/core_ext/string/output_safety.rb:74:in `concat'
activesupport (3.0.1) lib/active_support/core_ext/string/output_safety.rb:74:in `concat'
actionpack (3.0.1) lib/action_view/template/handlers/erb.rb:14:in `<<'
app/views/browse/businesses.html.erb:15:in `block in _app_views_browse_businesses_html_erb___1616718260917998189_2173630500__1134905695726531092'
app/views/browse/businesses.html.erb:3:in `each'
app/views/browse/businesses.html.erb:3:in `each_with_index'
app/views/browse/businesses.html.erb:3:in `_app_views_browse_businesses_html_erb___1616718260917998189_2173630500__1134905695726531092'

Does anyone else have this problem? Is ruby-1.9.2-p0 the correct version to use?

Thanks!

  • 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-19T04:08:23+00:00Added an answer on May 19, 2026 at 4:08 am

    You need to add this to every .rb file:

    <% # coding: UTF-8 %>
    

    I use the gem magic_encoding for that.

    $ cd app/ 
    $ magic_encoding
    

    The default is UTF-8, but you can specify whatever you want as an argument.

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

Sidebar

Related Questions

I had a RoR app working fun under Fedora14, I upgraded to Fedora16 and
I upgraded to XCode 3.2.3 recently, and now, I see i can't set a
Upgraded 10.6 from 10.5 and now postgres 8.1 is whacked. To make things worse
I upgraded the authentication in my application to use Rails 3.1's has_secure_password facility. In
I upgraded my ubuntubox from 10.10 to 11.04 and after that i have problem.
I upgraded to Rails 3.2.0 from Rails 3.1.3. All my tests were running nicely
I upgraded a Rails 3.0 app to Rails 3.1 which involved putting this /*
I upgraded to Lion and am now seeing an error when installing the rmagick
I upgraded my app to universal, but am not ready yet to release the
I upgraded from Struts 2.0.6 to 2.1.6 and converted all my Ajax themes to

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.