gpt4 book ai didi

ruby-on-rails - spree 's latest version does this on remote - undefined method ` set_preference' 为 nil :NilClass

转载 作者:行者123 更新时间:2023-12-04 22:24:43 24 4
gpt4 key购买 nike

在我的本地一切正常。我在服务器上适本地安装了所有东西,当我运行 rake db:bootstraprake db:migrate 时,我得到了这个:

rake aborted!
undefined method `set_preference' for nil:NilClass
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/chrisisraw/webapps/rails/gems/bundler/gems/spree-17e74dd1e908/core/lib/spree/preference_access.rb:18:in `set'
/home/chrisisraw/webapps/rails/gems/bundler/gems/spree-17e74dd1e908/core/lib/spree/preference_access.rb:17:in `each'
/home/chrisisraw/webapps/rails/gems/bundler/gems/spree-17e74dd1e908/core/lib/spree/preference_access.rb:17:in `set'
/home/chrisisraw/webapps/rails/Live-Jolly-Foods/config/initializers/jolly.rb:1
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/engine.rb:201
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/engine.rb:200:in `each'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/engine.rb:200
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/home/chrisisraw/webapps/rails/Live-Jolly-Foods/config/environment.rb:5
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/home/chrisisraw/webapps/rails/gems/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/application.rb:103:in `require_environment!'
/home/chrisisraw/webapps/rails/gems/gems/railties-3.0.5/lib/rails/application.rb:216
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/ruby1.8.7ee/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/local/ruby1.8.7ee/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/chrisisraw/webapps/rails/gems/bundler/gems/spree-17e74dd1e908/core/lib/tasks/core.rake:71
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/ruby1.8.7ee/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/chrisisraw/webapps/rails/gems/gems/rake-0.8.7/bin/rake:31
/home/chrisisraw/webapps/rails/bin/rake:19:in `load'
/home/chrisisraw/webapps/rails/bin/rake:19

有没有人弄清楚这个?

最佳答案

您不必删除初始化程序文件 initializers/whatever.rb,只需测试 spree 实例是否存在:

if Spree::Config.instance
Spree::Config.set(:stylesheets => 'screen')
end

关于ruby-on-rails - spree 's latest version does this on remote - undefined method ` set_preference' 为 nil :NilClass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5653803/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com