Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.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_Yaml_Fixtures - Fatal编程技术网

Ruby on rails 在装置和唯一标识符中使用合并键错误

Ruby on rails 在装置和唯一标识符中使用合并键错误,ruby-on-rails,yaml,fixtures,Ruby On Rails,Yaml,Fixtures,我正在尝试使用Rails YAML装置的合并关键点。我有: BOOK: &BOOK name: To Kill a Mocking Bird upc: 0215192786624 item_a: owner: user_a <<: *BOOK item_b: owner: user_b <<: *BOOK BOOK:&BOOK 名字:杀死一只知更鸟 upc:0215192786624 项目a: 所有者:用户_a 您必须在项目a和项目b

我正在尝试使用Rails YAML装置的合并关键点。我有:

BOOK: &BOOK
  name: To Kill a Mocking Bird
  upc: 0215192786624

item_a:
  owner: user_a
  <<: *BOOK

item_b:
  owner: user_b
  <<: *BOOK
BOOK:&BOOK
名字:杀死一只知更鸟
upc:0215192786624
项目a:
所有者:用户_a

您必须在项目a和项目b上指定具体的ID。

我想知道这是否是由于合并键在ruby 1.9中不起作用的问题造成的。更具体地说,切换到psych yaml解析器: