Eduardo R
2010-Sep-26 16:42 UTC
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:in `encode'' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `each'' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `map'' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `each'' /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:9:in `each_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:in `tables'' /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:in `initialize'' /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:in `up'' /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:in `call'' /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:in `each'' /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:in `invoke_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:in `invoke_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:in `invoke_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:in `each'' /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: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: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:in `run'' /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:in `run'' /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! -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Sep-26 22:38 UTC
Re: undefined method `force_encoding'' for "schema_migrations":String
On Sep 26, 5:42 pm, Eduardo R <eduardo.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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:in `encode'' > /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `each'' > /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `map'' > /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:10:in `each'' > /home/th48283/aj/config/initializers/fix_mysql_utf8.rb:9:inThat initializer is calling a method that only exists in ruby 1.9 Fred -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.