0

Added Mongoid but got:

LoadError:
Error loading the 'sqlite3' Active Record adapter.

Removed database.yml and got:

Could not load database configuration. No such file - ["config/database.yml"]

Saved empty database.yml and got:

ActiveRecord::AdapterNotSpecified:
'test' database is not configured. Available: []

Rails 5.2.2

2 Answers 2

1

If it is fresh install use

rails new app --skip-active-record

if you already created an App with rails, which has active-record(mysql or sqlite3) use this link:

Rails with Mongoid

Also remove

active records

lines from

application.rb

Sign up to request clarification or add additional context in comments.

Comments

0

ActiveRecord is a library that works only with relational databases. If you want to use MongoDB with mongoid, you don't need ActiveRecord. Remove any mention of AR and relational DBs from the application code, config and Gemfile. If you're stating from scratch, use rails new myapp --skip-active-record

See also: https://gorails.com/guides/setting-up-rails-4-with-mongodb-and-mongoid (related to Rails 4, but should help).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.