Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.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/5/ruby/24.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 为什么“mongorestore”没有修复我的收藏_Ruby On Rails_Ruby_Mongodb_Mongorestore - Fatal编程技术网

Ruby on rails 为什么“mongorestore”没有修复我的收藏

Ruby on rails 为什么“mongorestore”没有修复我的收藏,ruby-on-rails,ruby,mongodb,mongorestore,Ruby On Rails,Ruby,Mongodb,Mongorestore,我有一个rails应用程序,它需要mongo转储一个测试数据库,我使用类似 mongorestore -d test_database dump/test_databse 当我从终端运行此命令时,一切正常 $ mongo test_database MongoDB shell version: 2.4.12 connecting to: test_database > db.users_user.count() 50 > db.users_posts.count() 100 但是

我有一个rails应用程序,它需要mongo转储一个测试数据库,我使用类似

mongorestore -d test_database dump/test_databse
当我从终端运行此命令时,一切正常

$ mongo test_database
MongoDB shell version: 2.4.12
connecting to: test_database
> db.users_user.count()
50
> db.users_posts.count()
100
但是当我使用Ruby运行相同的命令时

system "mongorestore -d test_database dump/test_databse"
未插入其中一个集合
users\u posts

$ mongo test_database
MongoDB shell version: 2.4.12
connecting to: test_database
> db.users_user.count()
50
> db.users_posts.count()
0
这是怎么回事?这是权限问题吗?我被难住了。

日志(服务器)?输出?您是否尝试了选项
--drop
?尝试了
--drop
选项,仍然相同