Undefined method `force_encoding' for "schema_migrations":String

Hi people!

I need some help with some scary problem. I using rails 2.3.8 and
can’t run my migrations. Strange thing is all works locally, but fail
on server. I think I’ve missed some configuration, but can’t find
which.

rails 2.3.8, ruby 1.8.7, mysql 2.8.1

rake db:migrate RAILS_ENV=“production” --trace
(in /home/th48283/aj)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
undefined method force_encoding' for "schema_migrations":String /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:5:inencode’
/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in each' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:inmap’
/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in each' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:9:ineach_orig’
/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:9:in each' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ activerecord-2.3.8/lib/active_record/connection_adapters/ mysql_adapter.rb:440:intables’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
activerecord-2.3.8/lib/active_record/connection_adapters/abstract/
schema_statements.rb:368:in initialize_schema_migrations_table' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ activerecord-2.3.8/lib/active_record/migration.rb:441:ininitialize’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
activerecord-2.3.8/lib/active_record/migration.rb:401:in new' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ activerecord-2.3.8/lib/active_record/migration.rb:401:inup’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
activerecord-2.3.8/lib/active_record/migration.rb:383:in migrate' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rails-2.3.8/ lib/tasks/databases.rake:112 /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:636:incall’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:636:in execute' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:631:ineach’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:631:in execute' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:597:ininvoke_with_call_chain’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/monitor.rb:242:in
synchronize' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:590:ininvoke_with_call_chain’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:583:in invoke' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:2051:ininvoke_task’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:2029:in top_level' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:2029:ineach’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:2029:in top_level' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:2068:instandard_exception_handling’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:2023:in top_level' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:2001:inrun’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
lib/rake.rb:2068:in standard_exception_handling' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/ lib/rake.rb:1998:inrun’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rake-0.8.7/
bin/rake:31
/usr/bin/rake:19:in `load’
/usr/bin/rake:19

Thanks a lot!

On Sep 26, 5:42 pm, Eduardo R [email protected] wrote:

/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in each' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:inmap’
/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `each’
/home/th48283/aj/config/initializers/fix_mysql_utf8.rb:9:in

That initializer is calling a method that only exists in ruby 1.9

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs