我正在尝试在我的本地机器上启动一个 RoR 应用程序。在运行 rakedb:bootstrap
时,一切正常,直到:
Create the admin user (press enter for defaults).
Email [spree@example.com]:
Password [spree123]:
rake aborted!
undefined method `preference_definitions' for nil:NilClass
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/app/models/preference.rb:31:in `definition'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/app/models/preference.rb:37:in `value'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activemodel-3.1.10/lib/active_model/dirty.rb:143:in `attribute_change'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activemodel-3.1.10/lib/active_model/dirty.rb:117:in `block in changes'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activemodel-3.1.10/lib/active_model/dirty.rb:117:in `map'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activemodel-3.1.10/lib/active_model/dirty.rb:117:in `changes'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/attribute_methods/dirty.rb:34:in `block in save!'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/attribute_methods/dirty.rb:33:in `tap'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:246:in `block in save!'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/database_statements.rb:194:in `transaction'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:208:in `transaction'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:246:in `save!'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree_core/preferences/model_hooks.rb:287:in `block (2 levels) in update_preferences'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree_core/preferences/model_hooks.rb:275:in `each'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree_core/preferences/model_hooks.rb:275:in `block in update_preferences'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree_core/preferences/model_hooks.rb:274:in `each'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree_core/preferences/model_hooks.rb:274:in `update_preferences'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/callbacks.rb:401:in `_run_save_callbacks'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/callbacks.rb:264:in `create_or_update'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/persistence.rb:37:in `save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/validations.rb:50:in `save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract/database_statements.rb:194:in `transaction'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:208:in `transaction'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:241:in `block in save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/transactions.rb:240:in `save'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/spree/preference_access.rb:20:in `set'
/home/nishant/voylla_website/db/seeds.rb:13:in `<top (required)>'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `block in load'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:640:in `new_constants_in'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:223:in `load_dependency'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activesupport-3.1.10/lib/active_support/dependencies.rb:234:in `load'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/railties-3.1.10/lib/rails/engine.rb:488:in `load_seed'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/gems/activerecord-3.1.10/lib/active_record/railties/databases.rake:301:in `block (2 levels) in <top (required)>'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bundler/gems/spree-22cd84cc71d9/core/lib/tasks/core.rake:93:in `block (2 levels) in <top (required)>'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bin/ruby_noexec_wrapper:14:in `eval'
/home/nishant/.rvm/gems/ruby-1.9.2-p320@voylla/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)
我不知道这是什么意思。我发现这个链接与我的问题有关。但我不知道在哪里可以更改狂欢配置或 RAILS_ENV。有人可以帮忙吗。
谢谢