spree/spree — Issue #1183: Stack level too deep while running spree migrations
Author: tvdeyen
Created: 2012-02-23 10:03:28+00:00
State: open

I have a working Rails 3.1.3 App.

I installed the gem from http://rubygems.org via:

`gem install spree`

I used the spree 1.0.0 command line tool to install spree in my existing and working app:

`spree install`

1. It breaks because of missing production db (GH #1182)
2. Running rake db:migrate by hand ends in following error:

```
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2. (called from at /Users/tvd/code/rails/cbl/config/application.rb:13)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => db:migrate => environment
```

Removing `gem 'spree'` from my `Gemfile` not only removes all these crazy deprecation notices but let me run the migrations. Sadly only until this point:

```
uninitialized constant AddCountOnHandToVariantsAndProducts::Variant
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library'
/Users/tvd/code/rails/cbl/db/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb:7:in `up'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:356:in `up'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:394:in `block (2 levels) in migrate'
/Users/tvd/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:394:in `block in migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:375:in `migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:507:in `migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:687:in `block (2 levels) in migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:744:in `call'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:744:in `ddl_transaction'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:686:in `block in migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:671:in `each'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:671:in `migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:549:in `up'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/migration.rb:530:in `migrate'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:161:in `block (2 levels) in '
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/tvd/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/gems/rake-0.9.2.2/bin/rake:33:in `'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/bin/rake:19:in `load'
/Users/tvd/.rvm/gems/ruby-1.9.3-p125@alchemy-2.1/bin/rake:19:in `

'
Tasks: TOP => db:migrate
```