未初始化的常量Spree :: User :: DestroyWithOrdersError

时间:2012-05-14 14:39:50

标签: ruby-on-rails spree

我是Spree的新手,基本上做了以下事情:

git克隆了git hub repo并创建了一个新项目。然后我查看了核心文件夹并获取了我需要的所有文件。我这样做的原因纯粹是因为我希望自定义Spree并进行一些更改。我做了一个bundle install并试着做一个bundle exec rake db:reset并遇到了我一直试图解决的错误。我查看了以下文件

- > / home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth 1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb,如下所示:Pastie。我还发现了Ryan Biggs评论的以下github问题github issue。我试过这个,但没有运气。

我在这里做错了什么。

  

未初始化的常量Spree :: User :: DestroyWithOrdersError   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:3:in

     

block in <top (required)>' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:2:in class_eval”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/app/controllers/spree/admin/admin_users_controller_decorator.rb:2:in   <top (required)>' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:13:in 阻止激活'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:12:in   glob' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/spree_auth-1.1.0/lib/spree/auth/engine.rb:12:in 激活”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:451:in   _run__1016855746__prepare__693579178__callbacks' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in __ run_callback”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in   _run_prepare_callbacks' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in run_callbacks'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in   prepare!' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in 准备!”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in block in <module:Finisher>' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in instance_exec'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in   run_initializers中的run' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:55:in 阻止   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in   each' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in run_initializers'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:136:in   initialize!' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in method_missing'/home/dj/Desktop/my_store/config/environment.rb:5:in   <top (required)>' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:103:in require_environment!”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:292:in   block (2 levels) in initialize_tasks' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in 称之为”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in   block in execute' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in 每个”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in   invoke_with_call_chain'execute' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in 阻止   /home/dj/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in   mon_synchronize' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in   block in invoke_prerequisites' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in 每个”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in   invoke_with_call_chain'invoke_prerequisites' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in 阻止   /home/dj/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in   mon_synchronize' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in   invoke' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in   block (2 levels) in top_level' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in 每个”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in   block in top_level' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in   top_level' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in 阻止运行'   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in   standard_exception_handling' /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in 运行”   /home/dj/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in   <top (required)>' /home/dj/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in 加载'/home/dj/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in`'   任务:TOP =&gt; db:reset =&gt;环境

1 个答案:

答案 0 :(得分:2)

DJJ,

安装Spree的推荐方法是:

$ gem install rails -v 3.2.3
$ gem install spree
$ rails new my_store
$ spree install my_store

您不希望将文件直接复制到您的应用中。 http://guides.spreecommerce.com/customization.html有一些关于自定义网站的良好资源。

http://speakerdeck.com/u/jsqu99/p/spreeconf-2012-introducing-spree-10很好地解释了如何构建Spree应用程序。