You can create a Rails project with help of MongoDB easily.
https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-os-x/
mongod
http://stackoverflow.com/questions/5973811/mongodb-data-directory-permissions
sudo chmod 777 /data/db
- Create your Rails project with the '--skip-active-record' switch.
rails new ruby-on-rails-with-mongodb --skip-active-record
- Remove sqlite3 from your Gemfile (if present), add Mongoid to your Gemfile, and run 'bundle'.
gem 'mongoid', '~> 6.0.0'
-
Run '
rails g mongoid:config
'. -
Mongoid is ready to go. The Rails generators for 'model', 'scaffold' etc have been overridden by Mongoid. Any models, scaffolds etc that you create will create classes that include the Mongoid::Document module instead of inheriting from ApplicationRecord in the models folder.