Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.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 使用hydra和vcr gem时请求未运行_Ruby On Rails_Ruby_Rubygems_Vcr_Hydra - Fatal编程技术网

Ruby on rails 使用hydra和vcr gem时请求未运行

Ruby on rails 使用hydra和vcr gem时请求未运行,ruby-on-rails,ruby,rubygems,vcr,hydra,Ruby On Rails,Ruby,Rubygems,Vcr,Hydra,我目前正在尝试使用typheous和hyrda进行post请求。我正在使用VCR gem测试响应 我当前收到以下错误:ArgumentError: 将数组与数组进行比较失败 当我运行此行时: hydra.run 我的要求如下: <Typhoeus::Request:0x007fb7523a8688 @base_url="http://dev.moodle.co.za/webservice/rest/server.php?", @original_options={:method=>:

我目前正在尝试使用typheous和hyrda进行post请求。我正在使用VCR gem测试响应

我当前收到以下错误:ArgumentError: 将数组与数组进行比较失败 当我运行此行时: hydra.run

我的要求如下:

<Typhoeus::Request:0x007fb7523a8688 @base_url="http://dev.moodle.co.za/webservice/rest/server.php?", @original_options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b51", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{:Accept=>"json"}}, @options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b515b10af", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus", :Accept=>"json"}, :maxredirs=>50}>
如果我删除userid和course id,它可以正常工作,但是一旦[0]有多个数组成员,我就会得到上面提到的错误

另外,如果我删除录像机宝石,然后它的作品很好

有什么建议可以解决这个问题吗

Failure/Error: expect(person.moodle_create_user()).to eq(["id"=>"5nasCrYKc5", "username"=>"testing_moodle_gem"])
     ArgumentError:
       comparison of Array with Array failed
     # ./lib/moodle/request.rb:31:in `run_request'
     # ./lib/moodle/request.rb:14:in `execute_request'
     # ./lib/moodle/request.rb:19:in `execute_and_return_response_body'
     # ./lib/moodle/person.rb:11:in `moodle_create_user'
     # ./spec/moodle/person_spec.rb:30:in `block (4 levels) in <top (required)>'
     # ./spec/moodle/person_spec.rb:29:in `block (3 levels) in <top (required)>'

你能给stacktrace添加一个链接吗?