Spork错误:nil的未定义方法'split':NilClass(NoMethodError)

时间:2011-12-07 01:23:58

标签: ruby-on-rails spork

任何想法会导致什么?它已经工作了几个月,直到今天。不知道我改变了什么。

我的机器上有spork 0.9.0.rc9 gem(OS X 10.7最新的所有操作系统更新)和我的Gemfile(Rails 3.1.1)。当我尝试运行spork --bootstrap时出现以下错误:

undefined method 'split' for nil:NilClass (NoMethodError)
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:10:in 'initialize'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:25:in 'new'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:25:in 'block in latest_load_paths'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:24:in 'each'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:24:in 'inject'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/gem_helpers.rb:24:in 'latest_load_paths'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork.rb:108:in 'other_spork_gem_load_paths'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork.rb:101:in 'detect_and_require'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:167:in ''
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/runner.rb:49:in 'find_test_framework'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/runner.rb:57:in 'run'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/lib/spork/runner.rb:10:in 'run'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/gems/spork-0.9.0.rc9/bin/spork:10:in ''
/Users/mm/.rvm/gems/ruby-1.9.2-p190/bin/spork:19:in 'load'
/Users/mm/.rvm/gems/ruby-1.9.2-p190/bin/spork:19:in ''

1 个答案:

答案 0 :(得分:1)

我遇到了类似的问题。它扔我了

“NoMethodError:nil的未定义方法`query_options':NilClass

你应该移动你的

Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

Spork.each_run do

end

那应该解决这个问题。