Wednesday, May 28, 2014

Rails + MongoDB

http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-ruby-on-rails-3/
http://www.rosipov.com/blog/rails-and-mongodb-with-cygwin/
http://garypickrell.wordpress.com/2012/02/16/installing-rvm-and-rails-on-cygwin/

http://gorails.com/blog/rails-4-0-with-mongodb-and-mongoid
http://support.mongohq.com/tutorials/rails-4-mongoid-heroku.html
http://blog.mongodb.org/post/53271876885/ruby-rails-mongodb-and-the-object-relational-mismatch
http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-ruby-on-rails-3/


On cygwin:

1. rails new my_app --skip-active-record
2. cd my_app
3. vi Gemfile (gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git')
4. bundle install
5. rails g mongoid:config
6. rails g scaffold Project name:String status:String
7. rails server

Go to "projects" web interface to add something, you can see it in mongodb:













[Note] my_app_development is specified by config generated in step 5 (config/mongoid.yml)
[Note] mongodb default db dir : mkdir -p /cygdrive/c/data/db


No comments:

Related Posts Plugin for WordPress, Blogger...