From: Bharat Ruparel Date: 2010-11-04T09:47:38+09:00 Subject: Re: Ruby 1.9.2 with Rails 3.0.1 Sorry about that. Was tired towards the end of the day and therefore a not so bright post. I owe it to the group to clear things up. To make a long story short, it was the character encoding problem with ruby 1.9.2. The following is a snippet of code from seeds.rb file courses = [ {:title => 'Principles of Good Cooking 1', :course_code => 'PGC1', :lessons => [{:title => 'Getting Started'}, {:title => 'Saut√©ing', :topics => [ {:tag => "Lecture", :title => "Introduction to Saut√©ing", :pages => [ {:title => "Video Lecture" }] }, {:tag => "Quiz", :title => "Test Your Saut√©ing IQ", :pages => [ {:title => "Questions" }] }, {:tag => "Taste Test", :title => "Cooking With Wine", :pages => [ {:title => "Introduction"}, {:title => "Instructions"}, {:title => "Taste Wine"}, {:title => "Reduce Wine"}, {:title => "Taste Reduced Wine"}, {:title => "Your Results" }, See that 'Saut√©ing', string? That is Sauteing with funny symbols over e for french. That was causing the rake db:seed command to fail (throw exception) as follows: bruparel:~/school → rake db:seed (in /Users/bruparel/school) rake aborted! /Users/bruparel/school/db/seeds.rb:3: invalid multibyte char (US-ASCII) /Users/bruparel/school/db/seeds.rb:3: invalid multibyte char (US-ASCII) /Users/bruparel/school/db/seeds.rb:3: syntax error, unexpected $end, expecting '}' {:title => 'Sautéing', ^ The solution was to put the following line at the top of this file (seeds.rb) # encoding: utf-8 Now rake db:seed ran fine and indeed populated the tables. I could see the correct character encoding in the databases (both SQLite3 and Postgres) but the display was coming out with plain "Sauteing" instead of the French rendition of "e", that was because of the following line in database.yml file. development: adapter: sqlite3 pool: 5 timeout: 5000 encoding: utf8 <--- because of this database: db/atk_school_development Instead it should be as follows: development: adapter: sqlite3 pool: 5 timeout: 5000 encoding: unicode <--- this works database: db/atk_school_development If someone can articulate some simple rules for character encoding in Ruby 1.9.2 p0 and Rails 3.0.1 environment, that will be quite useful. Thanks. Bharat -- Posted via http://www.ruby-forum.com/.