gpt4 book ai didi

ruby-on-rails - cache_money 'nil.repository' 错误

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

我只是在现有应用程序上试用 cache_money gem 并收到此错误:

NoMethodError (You have a nil object when you didn't expect it!
The error occurred while evaluating nil.repository)

我想我已经正确配置了我的 memached 服务器。
我正在使用 Rails 2.2.2

编辑:

堆栈跟踪:
NoMethodError (You have a nil object when you didn't expect it!
The error occurred while evaluating nil.repository):
(__DELEGATION__):2:in `__send__'
(__DELEGATION__):2:in `repository'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cache_money.rb:50:in `transaction'
/vendor/rails/activerecord/lib/active_record/transactions.rb:138:in `transaction'
/vendor/rails/activerecord/lib/active_record/transactions.rb:178:in `with_transaction_returning_status'
/vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save_without_trace_ActiveRecord___self_class_name__save'
/vendor/rails/activerecord/lib/active_record/transactions.rb:158:in `rollback_active_record_state!'
/vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save_without_trace_ActiveRecord___self_class_name__save'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:138:in `save_without_trace_ActiveRecord_save'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:137:in `save_without_trace_ActiveRecord_save'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:141:in `save_without_trace_ActiveRecord_all'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:141:in `save'
/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:237:in `create'
/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:405:in `create_record'
/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:423:in `add_record_to_target_with_callbacks'
/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:405:in `create_record'
/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:235:in `create'
/app/controllers/application.rb:234:in `write_audit_log'
/app/controllers/application.rb:224:in `write_read_audit_log'
/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/vendor/rails/actionpack/lib/action_controller/filters.rb:662:in `run_after_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in `call_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:136:in `perform_action_without_caching'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action_without_newrelic_trace'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action_without_newrelic_trace'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:123:in `perform_action'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:41:in `trace_method_execution_with_scope'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:109:in `perform_action'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:18:in `trace_method_execution_no_scope'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:103:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:524:in `process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:134:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:392:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:183:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:123:in `dispatch_without_newrelic'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:122:in `synchronize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:122:in `dispatch_without_newrelic'
/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/dispatcher_instrumentation.rb:44:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:39:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `orig_process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `orig_process_client'
/vendor/plugins/spawn/lib/patches.rb:59:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load_without_new_constant_marking'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:142:in `load'
/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
/vendor/rails/railties/lib/commands/server.rb:49
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3

最佳答案

如果您根据使用目的使用 cache_money(很难从您提供的内容中看出),则它可能是 cache_money 中的一个错误。 github项目中报告了其他nil引用错误,其中一些自0.2.5版本以来已解决。

您可以在 Rails 项目中以插件形式查看最新版本的代码:

script/plugin git://github.com/nkallen/cache-money.git

也许自从您拥有的版本以来,他们已经解决了您的问题。如果没有帮助,您可以从 vendor/plugins/cache-money 中删除该插件.

如果这没有帮助,您可以在作者的问题跟踪器上提交您的问题 http://github.com/nkallen/cache-money ,看看他们是否可以为您解决。

关于ruby-on-rails - cache_money 'nil.repository' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1346108/

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