Rails+MongoDB:“没有要加载的文件”
MongoDB 新手,正在尝试让第二测试项目正常运行。我强调第二,因为我想知道这是否可能是问题的一部分,如 /data/db/
我仍然拥有第一个概念验证的文件MongoDB <- MongoID ->几周前我毫无问题地启动并运行了 Rails 项目。
现在,我正在尝试使用一些标志 (-T -O -J
) 从头开始构建一个新 Rails 项目,然后运行关联的安装/配置生成器:mongoid:config、rspec:install、jquery:install
。
到目前为止一切顺利......直到我生成第一个脚手架,然后尝试访问它并获得响应:
“没有要加载的文件 - 供应商”
现在,我并不太惊讶,因为/data/db/
中没有新的 xxx_development.x
文件。但我不记得第一次创建它们,并且我一直使用的教程没有提到这样的步骤?早发性衰老?还是出了什么问题?也许 MongoDB(或 MongoID)只能处理每个数据库目录一个 MongoDB?!?
#Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.4'
gem 'mongoid', '2.0.0.rc.7'
gem 'bson_ext'
...
使用默认的mongoid.yml
。
我已经搜索了相关问题,有很多,但大多数要么在加载 gem 时遇到问题,这不是我的情况,要么声明 bson_ext
版本必须与 mongoid 匹配
版本..但大多数情况看起来都很旧,现在我什至认为 mongoid
接近 2.0
和 bson_ext
是不可能的> 仍为 1.2
。
New to MongoDB and trying to get a second test project working. I emphasize second because I'm wondering if that may be part of the problem as in /data/db/
i still have the files for the first proof-of-concept MongoDB <- MongoID -> Rails project that I got up and running without a problem a few weeks ago.
Now I'm experimenting with building a new Rails project from scratch with some flags (-T -O -J
) and then running the associated install/config generators: mongoid:config, rspec:install, jquery:install
.
So far so good... until I generate my first scaffold and then try to access it and get the response:
"No such file to load -- vendor"
now, I'm not too surprised as there's no new xxx_development.x
files in /data/db/
. But I don't remember creating them the first time and tutorials I've been using don't mention such a step? Early onset senility? Or is something amiss? Perhaps MongoDB (or MongoID) can only handle one MongoDB per db directory?!?
#Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.4'
gem 'mongoid', '2.0.0.rc.7'
gem 'bson_ext'
...
Using default mongoid.yml
.
I've searched S.O. for related problems and there were many but most either have problems loading a gem, which is not my case, or state that the bson_ext
version must match the mongoid
version.. but most of these cases seem old and now I don't even think that's possible with mongoid
approaching 2.0
and bson_ext
still at 1.2
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过从头开始构建另一个测试应用程序来解决这个问题。似乎有一个错误(或者我缺乏理解),可能与
-J
标志到rails new
(或使用- 的组合)有关J
、-T
和-O
标志同时出现?)。无论如何,它取消了application.rb
中以下行的注释:应为:
添加“
jquery Rails
”使应用程序正常工作...不确定资源名称必须是什么处理原始错误消息!?!红鲱鱼?Figured it out by building another test app from scratch. there seems to be a bug (or my lack of understanding) somewhere perhaps involved with the
-J
flag torails new
(or with the combo of using the-J
,-T
&-O
flags at same time?). Anyway, it uncomments the following line inapplication.rb
:which should read:
adding "
jquery rails
" made the app work... not sure what the resource name had to do with the original error message!?! Red Herring?