This project is archived and is in readonly mode.

#4891 ✓committed
James B. Byrne

Rails-2.3.8 db:migrate gives undefined method `length' for :any_index:Symbol

Reported by James B. Byrne | June 17th, 2010 @ 07:02 PM | in 2.3.10

I had occasion to re-run the migration for a Rails project and I get the error given below. I get this only with 2.3.8. Rails-2.3.5, to which I have reverted, does not have this problem.

$ rake -t db:migrate
(in /home/byrnejb/Software/Development/Projects/proforma.git)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  CreateSessions: migrating =================================================
-- create_table(:sessions)
   -> 0.0015s
-- add_index(:sessions, :session_id, {:unique=>true, :name=>:idxr_sessions_session_id})
rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `length' for :idxr_sessions_session_id:Symbol
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:281:in `add_index'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `send'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `method_missing'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'
/home/byrnejb/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:348:in `method_missing'
./db/migrate//00110_create_sessions.rb:13:in `up_without_benchmarks'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `send'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'
/home/byrnejb/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `__send__'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `migrate'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:491
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `call'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `ddl_transaction'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/transactions.rb:182:in `transaction'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `ddl_transaction'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:490:in `migrate'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `each'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `migrate'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in `up'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/activerecord-2.3.8/lib/active_record/migration.rb:383:in `migrate'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rails-2.3.8/lib/tasks/databases.rake:112
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/home/byrnejb/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/gems/rake-0.8.7/bin/rake:31
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/bin/rake:24:in `load'
/home/byrnejb/.rvm/gems/ruby-1.8.7-p249/bin/rake:24

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages