新手问题 把 ruby-china clone 了下来,里面的数据库的配置问题?

wangping · 2013年12月23日 · 最后由 leslin123 回复于 2014年01月27日 · 2960 次阅读

最主要的问题:我想知道选择节点的那个表在哪里??~~

我研究的好久,大概知道用了两个东东,redies 和 mongo~~但是有好多不理解的地方,哪边会有解释呢,比如:development: <<: *defaults 就不是太看得懂

运行 ruby setup.rb 或者执行 bundle exec rake db:seed,会安装初始化数据,里面有个叫 nodes 的 collection,就是存储选择节点的

@miraclew 我运行了,但是节点为空的,出现了好多的 waring

ruby-china aaaa$ ruby setup.rb

Now Installing Ruby China...

Checking Package Dependencies...

Bundler [Yes] MongoDB 2.0+ [Yes] Redis 2.0+ [Yes] Memcached 1.4+ [Yes]

ImageMagick 6.5+ [Yes]

Configure

Your MongoDB host (default: 127.0.0.1:27017):

Your Redis host (default: 127.0.0.1:6379):

Install gems... [Done] Seed default data...[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. [Done]

Ruby China Successfully Installed.

这个是我运行的结果,我估计你是没有启动服务或缺少 Gem, 你可以把具体 warning 贴出来

@miraclew 我可以浏览界面的,我截图你看看

@miraclew bundle exec rake db:seed W, [2013-12-23T16:23:34.052348 #24982] WARN -- : Overwriting existing field _id. [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. W, [2013-12-23T16:23:41.397946 #24982] WARN -- : Overwriting existing field _id. W, [2013-12-23T16:23:41.401241 #24982] WARN -- : Overwriting existing field _type. W, [2013-12-23T16:23:41.403012 #24982] WARN -- : Overwriting existing field _type. W, [2013-12-23T16:23:42.072352 #24982] WARN -- : Overwriting existing field _id. W, [2013-12-23T16:23:43.020862 #24982] WARN -- : Overwriting existing field _id.

这是出的 warning

@miraclew 你能不能告诉我那个存放节点的 collection?

use ruby_china_dev switched to db ruby_china_dev show collections mongoid.auto_increment_ids nodes sections site_configs site_nodes system.indexes topics users

db.nodes.find() { "sort" : 0, "topics_count" : 1, "name" : "Ruby", "summary" : "...", "section_id" : 1, "updated_at" : ISODate("2013-12-18T02:08:57.664Z"), "created_at" : ISODate("2013-12-18T02:08:57.664Z"), "_id" : 1 } { "sort" : 0, "topics_count" : 0, "name" : "Ruby on Rails", "summary" : "...", "section_id" : 1, "updated_at" : ISODate("2013-12-18T02:08:57.669Z"), "created_at" : ISODate("2013-12-18T02:08:57.669Z"), "_id" : 2 }

@miraclew oh,我 collection 里面只有 4 个

@wangping @miraclew 这些 warning 后面是怎么解决的啦?

W, [2013-12-23T16:23:41.397946 #24982] WARN -- : Overwriting existing field _id.
W, [2013-12-23T16:23:41.401241 #24982] WARN -- : Overwriting existing field _type.
W, [2013-12-23T16:23:41.403012 #24982] WARN -- : Overwriting existing field _type.
W, [2013-12-23T16:23:42.072352 #24982] WARN -- : Overwriting existing field _id.
W, [2013-12-23T16:23:43.020862 #24982] WARN -- : Overwriting existing field _id
需要 登录 后方可回复, 如果你还没有账号请 注册新账号