I''ve just done a fresh reinstall of OS X Snow Leopard on my mac, and I''m having all kinds of problems with Rails, but the latest problem has me stumped. Whenever I run rake db:seed to populate my database I hit the following error: ** Invoke db:seed (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:seed rake aborted! uninitialized constant ActiveSupport::Multibyte::Chars::Encoding /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `const_missing'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/multibyte/chars.rb:86:in `initialize'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in `new'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in `mb_chars'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:798:in `validates_uniqueness_of'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:468:in `validates_each'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in `each'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in `validates_each'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in `call'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in `evaluate_method'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:166:in `call'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in `run'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in `each'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in `send'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in `run'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:276:in `run_callbacks'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1098:in `valid_without_callbacks?'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:315:in `valid_without_lifecycles?'' /Library/Ruby/Gems/1.8/gems/hobo-0.8.10/lib/hobo/lifecycles.rb:67:in `valid?'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1077:in `save_without_dirty'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:79:in `save_without_transactions'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in `send'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in `save'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in `save'' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:723:in `create'' /Users/iainbeeston/Documents/Programs/Ruby/inspect/db/seeds.rb:9 /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load'' /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:215 /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load'' /usr/bin/rake:19 It turns out that it''s failing when it tries to do validate_unique on a text field. When I look into the rails code that''s throwing the error it''s coming up because it can''t find Encoding::UTF_8. What''s more, if I skip db:seed and just start up the webserver I get a different error but it comes down to the exact same cause (can''t find Encoding::UTF_8). The problem is that I can''t even figure out where this module is supposed to be! Is it rails or is it ruby? Or is it expecting a gem that I don''t have? I really have no idea (and google isn''t helping much). My setup is: Ruby 1.8.7 Rails 2.3.4 Database Mysql 5.1 64bit (MySQL gem 2.8.1 also in 64bit) OS Mac OSX SNow Leopard 64bit Has anyone seen this before? Can anyone suggest a fix? Thanks! -- Posted via http://www.ruby-forum.com/.
Encoding shows up in Ruby 1.9 as part of the multibyte change made to String. That said, Rails 2.3.4 does make reference to Encoding::UTF_8 but those references are conditional. If you look at "activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb" you''ll see the gory details. I can run db:seed with Ruby1.8.7/Rails2.3.4 with no problem. ruby --version => ruby 1.8.7 (2009-06-08 patchlevel 173) [powerpc-darwin9.7.0] rails --version => Rails 2.3.4 gem list mysql => mysql (2.8.1) mysql --version => mysql Ver 14.14 Distrib 5.1.39, for apple-darwin9.5.0 (powerpc) using readline 5.1 database.yml: development: adapter: mysql encoding: utf8 reconnect: false socket: /tmp/mysql.sock database: auth-1.8_dev pool: 5 username: **** password: ******** seeds.rb Page.create(:title => "It''s all about the pie...", :body => "Welcome to Journeys") On Nov 13, 5:10 pm, Iain Beeston <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve just done a fresh reinstall of OS X Snow Leopard on my mac, and I''m > having all kinds of problems with Rails, but the latest problem has me > stumped. > > Whenever I run rake db:seed to populate my database I hit the following > error: > > ** Invoke db:seed (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:seed > rake aborted! > uninitialized constant ActiveSupport::Multibyte::Chars::Encoding > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in > `const_missing'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/multibyte/chars.rb:86:in > `initialize'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in > `new'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in > `mb_chars'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:798:in > `validates_uniqueness_of'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:468:in > `validates_each'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in > `each'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in > `validates_each'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in > `call'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in > `evaluate_method'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:166:in > `call'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `run'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `each'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `send'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `run'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:276:in > `run_callbacks'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1098:in > `valid_without_callbacks?'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:315:in > `valid_without_lifecycles?'' > /Library/Ruby/Gems/1.8/gems/hobo-0.8.10/lib/hobo/lifecycles.rb:67:in > `valid?'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1077:in > `save_without_dirty'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:79:in > `save_without_transactions'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in > `send'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in > `with_transaction_returning_status'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in > `transaction'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:in > `transaction'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:228:in > `with_transaction_returning_status'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in > `save'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in > `rollback_active_record_state!'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in > `save'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:723:in > `create'' > /Users/iainbeeston/Documents/Programs/Ruby/inspect/db/seeds.rb:9 > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load_without_new_constant_marking'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in > `new_constants_in'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load'' > /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:215 > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in > `invoke_with_call_chain'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in > `synchronize'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in > `invoke_with_call_chain'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 > /usr/bin/rake:19:in `load'' > /usr/bin/rake:19 > > It turns out that it''s failing when it tries to do validate_unique on a > text field. When I look into the rails code that''s throwing the error > it''s coming up because it can''t find Encoding::UTF_8. What''s more, if I > skip db:seed and just start up the webserver I get a different error but > it comes down to the exact same cause (can''t find Encoding::UTF_8). > > The problem is that I can''t even figure out where this module is > supposed to be! Is it rails or is it ruby? Or is it expecting a gem that > I don''t have? I really have no idea (and google isn''t helping much). > > My setup is: > > Ruby 1.8.7 > Rails 2.3.4 > Database Mysql 5.1 64bit (MySQL gem 2.8.1 also in 64bit) > OS Mac OSX SNow Leopard 64bit > > Has anyone seen this before? Can anyone suggest a fix? > > Thanks! > -- > Posted viahttp://www.ruby-forum.com/.
It''s hobo that''s whacking you. On Nov 13, 5:10 pm, Iain Beeston <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''ve just done a fresh reinstall of OS X Snow Leopard on my mac, and I''m > having all kinds of problems with Rails, but the latest problem has me > stumped. > > Whenever I run rake db:seed to populate my database I hit the following > error: > > ** Invoke db:seed (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:seed > rake aborted! > uninitialized constant ActiveSupport::Multibyte::Chars::Encoding > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in > `const_missing'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/multibyte/chars.rb:86:in > `initialize'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in > `new'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/multibyte.rb:44:in > `mb_chars'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:798:in > `validates_uniqueness_of'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:468:in > `validates_each'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in > `each'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:465:in > `validates_each'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in > `call'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:182:in > `evaluate_method'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:166:in > `call'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `run'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `each'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `send'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:90:in > `run'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:276:in > `run_callbacks'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1098:in > `valid_without_callbacks?'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:315:in > `valid_without_lifecycles?'' > /Library/Ruby/Gems/1.8/gems/hobo-0.8.10/lib/hobo/lifecycles.rb:67:in > `valid?'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1077:in > `save_without_dirty'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:79:in > `save_without_transactions'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in > `send'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:in > `with_transaction_returning_status'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in > `transaction'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:in > `transaction'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:228:in > `with_transaction_returning_status'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in > `save'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:in > `rollback_active_record_state!'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:in > `save'' > /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:723:in > `create'' > /Users/iainbeeston/Documents/Programs/Ruby/inspect/db/seeds.rb:9 > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load_without_new_constant_marking'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in > `new_constants_in'' > /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in > `load'' > /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:215 > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in > `invoke_with_call_chain'' > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in > `synchronize'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in > `invoke_with_call_chain'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in > `standard_exception_handling'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' > /Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31 > /usr/bin/rake:19:in `load'' > /usr/bin/rake:19 > > It turns out that it''s failing when it tries to do validate_unique on a > text field. When I look into the rails code that''s throwing the error > it''s coming up because it can''t find Encoding::UTF_8. What''s more, if I > skip db:seed and just start up the webserver I get a different error but > it comes down to the exact same cause (can''t find Encoding::UTF_8). > > The problem is that I can''t even figure out where this module is > supposed to be! Is it rails or is it ruby? Or is it expecting a gem that > I don''t have? I really have no idea (and google isn''t helping much). > > My setup is: > > Ruby 1.8.7 > Rails 2.3.4 > Database Mysql 5.1 64bit (MySQL gem 2.8.1 also in 64bit) > OS Mac OSX SNow Leopard 64bit > > Has anyone seen this before? Can anyone suggest a fix? > > Thanks! > -- > Posted viahttp://www.ruby-forum.com/.
You got me thinking about dependent gems that I''m using (rather than rails) and it turns out that the problem is caused by a gem called google-spreadsheet-ruby (it allows you to access and parse google spreadsheets from ruby). This gem defines String.force_encoding for Ruby 1.8, however, rails is using this method to test whether it''s running on top of Ruby 1.8 or Ruby 1.9 - so it think''s it''s using Ruby 1.9 when actually it''s using Ruby 1.8, and then quickly hits problems and crashes. I''ve notified the author of the gem and suggested a solution, and I''ve patched my own app for now as well (to undefine this method entirely as the gem is an unused dependency in my project) and everything''s working again. :-) -- Posted via http://www.ruby-forum.com/.
Maybe Matching Threads
- Rails 3 bug: undefined method `<=>' for class `ActiveSupport::Multibyte::Chars'
- Accessing Rails helper method with_output_buffer
- validates_uniqueness_of fails on STI in Rails 2.3.2
- Error: uninitialized constant MysqlCompat::MysqlRes
- Issues creating tables in mysql tests