Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError while following Extensions in Developer's Guide #5442

Closed
davidsherline opened this issue Oct 4, 2014 · 1 comment
Closed

Comments

@davidsherline
Copy link

Hello, I am following the Extensions tutorial in the Developer's Guide. While setting sale_price for a product variant in the Rails console, the call to variant.save produces an ArgumentError (see below). I've tried using various versions of Rails between 4.1.2 and 4.1.6 and each produces the same error. Please advise how I might continue the tutorial as expected. Thanks!

THE ERROR:

ArgumentError: A copy of Spree::Preferences::Configuration has been removed from the module tree but is still active!
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:465:in load_missing_constant' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:180:inconst_missing'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spree_core-2.3.3/app/models/spree/preferences/configuration.rb:32:in preferences' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spree_core-2.3.3/app/models/spree/preferences/preferable_class_methods.rb:13:inblock in preference'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spree_core-2.3.3/app/models/spree/preferences/preferable.rb:43:in get_preference' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spree_core-2.3.3/app/models/spree/variant.rb:24:inblock in class:Variant'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/builder/association.rb:64:in instance_exec' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/builder/association.rb:64:inblock in initialize'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:149:in instance_exec' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:149:ineval_scope'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:112:in block (2 levels) in add_constraints' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:111:ineach'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:111:in block in add_constraints' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:69:ineach'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:69:in each_with_index' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/associations/association_scope.rb:69:inadd_constraints'
... 68 levels...
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:69:in console' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:inrun_command!'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/railties-4.1.6/lib/rails/commands.rb:17:in <top (required)>' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:inrequire'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:inblock in require'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in load_dependency' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:inrequire'
from /Users/David/Sites/tutorials/spree/mystore/bin/rails:8:in <top (required)>' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:inload'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in block in load' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:inload_dependency'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in load' from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/var/rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

@JDutil
Copy link
Member

JDutil commented Oct 6, 2014

@Hypsol I'm not able to reproduce this error. You'll have to provide the information requested in our Contributing Guidelines including steps to reproduce the error.

It sounds related to Rails 4.1 and spring though, and likely will go away if you exit and reenter the console. There is another similar issue that I consider this to be a duplicate of with some more information: #5104

@JDutil JDutil closed this as completed Oct 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants