最主要的问题:我想知道选择节点的那个表在哪里??~~
我研究的好久,大概知道用了两个东东,redies 和 mongo~~但是有好多不理解的地方,哪边会有解释呢,比如:development: <<: *defaults 就不是太看得懂
运行 ruby setup.rb 或者执行 bundle exec rake db:seed,会安装初始化数据,里面有个叫 nodes 的 collection,就是存储选择节点的
ruby-china aaaa$ ruby setup.rb
Bundler [Yes] MongoDB 2.0+ [Yes] Redis 2.0+ [Yes] Memcached 1.4+ [Yes]
Your MongoDB host (default: 127.0.0.1:27017):
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 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.
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 }
@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