Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 测量员_Ruby On Rails_Ruby_Surveyor Gem_Grep - Fatal编程技术网

Ruby on rails 测量员

Ruby on rails 测量员,ruby-on-rails,ruby,surveyor-gem,grep,Ruby On Rails,Ruby,Surveyor Gem,Grep,我被困在使用测量器gem设置一个简单的rails测量中。我遵循这里给出的关于新rails项目的基本说明: 此外,为了解决rails 4的问题,我的文件还包括以下内容: gem 'surveyor', :git => 'git://github.com/NUBIC/surveyor.git', :branch => 'rails4' gem 'formtastic' 当我尝试运行演示调查(厨房水槽)时,我最终出现以下错误: NoMethodError in SurveyorContr

我被困在使用测量器gem设置一个简单的rails测量中。我遵循这里给出的关于新rails项目的基本说明:

此外,为了解决rails 4的问题,我的文件还包括以下内容:

gem 'surveyor', :git => 'git://github.com/NUBIC/surveyor.git', :branch => 'rails4'
gem 'formtastic'
当我尝试运行演示调查(厨房水槽)时,我最终出现以下错误:

NoMethodError in SurveyorController#edit
undefined method `with_sections_and_questions' for #<Class:0x007fe84d519450>

编辑:完整跟踪:

activerecord (4.0.0) lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-70ed3f257416/lib/surveyor/surveyor_controller_methods.rb:63:in `edit'
app/controllers/surveyor_controller.rb:21:in `edit'
actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.0) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.0) lib/active_support/callbacks.rb:443:in `_run__290069008777388403__process_action__callbacks'   
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.0) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.0) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/railtie/configurable.rb:30:in `method_missing'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__3872098118566400954__call__callbacks'
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Request

Parameters:

{"survey_code"=>"kitchen-sink-survey",
  "response_set_code"=>"tyr1KN5kAw"}
编辑2:按要求发布grep

$ grep with_sections_and_questions $(bundle show surveyor) -r – 
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-     70ed3f257416/lib/surveyor/models/response_set_methods.rb:        { :questions =>     survey.with_sections_and_questions.sections.map(&:questions).flatten.compact.size,
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-70ed3f257416/lib/surveyor/models/response_set_methods.rb:        qs = survey.with_sections_and_questions.sections.map(&:questions).flatten
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-70ed3f257416/lib/surveyor/surveyor_controller_methods.rb:        @survey = Survey.with_sections_and_questions.find_by_id(@response_set.survey_id)
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-70ed3f257416/spec/models/survey_spec.rb:      survey.with_sections_and_questions.sections.map(&:questions).flatten.should have(4).questions
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/surveyor-70ed3f257416/spec/models/survey_spec.rb:      survey.with_sections_and_questions.sections.map(&:questions).flatten.should == [q4,q1,q3,q2]
grep: –: No such file or directory
编辑3:添加更多信息:

$ grep with_sections_and_questions /usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/ -r;
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems//surveyor-70ed3f257416/lib/surveyor/models/response_set_methods.rb:        { :questions => survey.with_sections_and_questions.sections.map(&:questions).flatten.compact.size, 
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems//surveyor-70ed3f257416/lib/surveyor/models/response_set_methods.rb:        qs = survey.with_sections_and_questions.sections.map(&:questions).flatten
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems//surveyor-70ed3f257416/lib/surveyor/surveyor_controller_methods.rb:        @survey = Survey.with_sections_and_questions.find_by_id(@response_set.survey_id)
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems//surveyor-70ed3f257416/spec/models/survey_spec.rb:      survey.with_sections_and_questions.sections.map(&:questions).flatten.should have(4).questions
/usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems//surveyor-70ed3f257416/spec/models/survey_spec.rb:      survey.with_sections_and_questions.sections.map(&:questions).flatten.should == [q4,q1,q3,q2]
错误:

undefined method `with_sections_and_questions' for #<Class:0x007fe84d519450>
如果没有找到类似于以下方法的定义:

def with_sections_and_questions

您必须向开发人员在他们的网站上发布一个问题。

谢谢您的帮助,我添加了跟踪。我添加了上面的结果,希望这个帮助,谢谢您的关注!谢谢你的帮助,我接受了你的回答,并开始了一个问题。我将在这里包括任何进一步的结果,以供以后参考。
grep with_sections_and_questions /usr/local/rvm/gems/ruby-2.0.0-p247/bundler/gems/ -r
def with_sections_and_questions