Ruby on rails Rails ActiveSupport unicode.rb中的NoMethodError

Ruby on rails Rails ActiveSupport unicode.rb中的NoMethodError,ruby-on-rails,activesupport,friendly-id,Ruby On Rails,Activesupport,Friendly Id,在我的rails 3.2.15项目中,由于active\u support/multibyte/unicode.rb,我的规范中出现了不一致的失败。有时规格不合格,有时合格。不过,除了测试之外,我还没见过它。每次都在代码的同一特定区域。这似乎是ActiveSupport正在加载unicode\u tables.dat的区域。更令人费解的是,如果我对所讨论的行进行ActiveSupport,并在它前面加上p以输出值,它实际上会通过之前失败的地方,然后进一步失败。FriendlyId在堆栈中,所以我

在我的rails 3.2.15项目中,由于
active\u support/multibyte/unicode.rb
,我的规范中出现了不一致的失败。有时规格不合格,有时合格。不过,除了测试之外,我还没见过它。每次都在代码的同一特定区域。这似乎是ActiveSupport正在加载
unicode\u tables.dat
的区域。更令人费解的是,如果我对所讨论的行进行ActiveSupport,并在它前面加上
p
以输出值,它实际上会通过之前失败的地方,然后进一步失败。FriendlyId在堆栈中,所以我想知道这是否与问题有关。我的代码中触发异常的那一行就是
update\u attributes!(:pdf_processing=>false)
。我错过了什么

 NoMethodError:
   undefined method `each' for nil:NilClass
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:350:in `load'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:335:in `codepoints'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:158:in `block in decompose_codepoints'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:147:in `each'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:147:in `inject'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:147:in `decompose_codepoints'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/multibyte/unicode.rb:291:in `normalize'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/inflector/transliterate.rb:62:in `transliterate'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/inflector/transliterate.rb:84:in `parameterize'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/core_ext/string/inflections.rb:155:in `parameterize'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly_id-4.0.10.1/lib/friendly_id/slugged.rb:245:in `normalize_friendly_id'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly_id-4.0.10.1/lib/friendly_id/slugged.rb:262:in `should_generate_new_friendly_id?'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly_id-4.0.10.1/lib/friendly_id/slugged.rb:273:in `set_slug'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:407:in `_run__895003607475416689__validation__177331951454965097__callbacks'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:405:in `__run_callback'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:81:in `run_callbacks'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activemodel-3.2.15/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activemodel-3.2.15/lib/active_model/validations.rb:195:in `valid?'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/validations.rb:69:in `valid?'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/validations.rb:77:in `perform_validations'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/validations.rb:56:in `save!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:264:in `block in save!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:208:in `transaction'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:264:in `save!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/persistence.rb:228:in `block in update_attributes!'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:208:in `transaction'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/persistence.rb:226:in `update_attributes!'
 # ./app/models/campaign.rb:291:in `ensure in generate_pdf'
 # ./app/models/campaign.rb:291:in `generate_pdf'
 # ./spec/models/campaign/generate_pdf_spec.rb:53:in `block (3 levels) in <top (required)>'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:114:in `instance_eval'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:114:in `block in run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:111:in `run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:390:in `block in run_examples'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:386:in `map'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:386:in `run_examples'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:371:in `run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:372:in `block in run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:372:in `map'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:372:in `run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `map'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `block in run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/reporter.rb:58:in `report'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:25:in `run'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in `run_tests'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
 # /home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
 # /home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
命名错误:
nil:NilClass的未定义方法“each”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:350:in'load'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:335:in`codepoints'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:158:在“分解码点中的块”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:147:in`each'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u-support/multibyte/unicode.rb:147:in'inject'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:147:in `分解\u码点'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/multibyte/unicode.rb:291:in“normalize”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u-support/endoctor/transiterate.rb:62:in“transiterate”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u-support/inchector/transiterate.rb:84:in“参数化”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/core\u ext/string/influctions.rb:155:在“参数化”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly\u id-4.0.10.1/lib/friendly\u id/slugged.rb:245:in“normalize\u-friendly\u id”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly\u id-4.0.10.1/lib/friendly\u id/slugged.rb:262:in“是否应该生成新的\u-friendly\u id?”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/friendly_id-4.0.10.1/lib/friendly_id/sluged.rb:273:in'set_slug'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u-support/callbacks.rb:407:in`“运行”中的895003607475416689\u验证\u 177331951454965097\u回调”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/callbacks.rb:405:在“运行回调”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/callbacks.rb:385:在“运行验证\u回调”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activesupport-3.2.15/lib/active\u support/callbacks.rb:81:in“run\u callbacks”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activemodel-3.2.15/lib/active\u model/validations/callbacks.rb:53:in“run\u validations!”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activemodel-3.2.15/lib/active_model/validations.rb:195:in'valid'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/validations.rb:69:in‘valid?’
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/validations.rb:77:in“执行\u验证”
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/validations.rb:56:in'save!'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/attribute\u methods/dirty.rb:33:in'save!'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/transactions.rb:264:在“保存中的块”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/transactions.rb:313:in `阻止进入并返回\u事务状态'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/connection\u adapters/abstract/database\u statements.rb:192:在“事务”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:208:在“事务”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/transactions.rb:311:in`with\u transaction\u returning\u status'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:264:in'save!'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/persistence.rb:228:in`block in update\u attributes!'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/transactions.rb:313:in `阻止进入并返回\u事务状态'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/connection\u adapters/abstract/database\u statements.rb:192:在“事务”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active_record/transactions.rb:208:在“事务”中
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/transactions.rb:311:in`with\u transaction\u returning\u status'
#/home/fletch/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.15/lib/active\u record/persistence.rb:226:in“update\u attributes!”
#./app/models/campaign.rb:291:“确保生成pdf”
#./app/models/campaign.rb:291:in'generate\u pdf'
#./spec/models/campaign/generate_pdf_spec.rb:53:in'block(3层)in'
#/home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:114:in“instance_eval”
#/home/fletch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/exampl