0

Overview

I'm working on a Ruby on Rails application but i cannot save any record on MongoDB.

Version's details: ruby "3.0.0", rails "7.0.4", devise "4.8.1", mongoid "7.0".

The goal is to connect my Rails application to mongodb atlas, so i did the next:

  1. Install the right gems.
  2. Create mongoid.yml file:
development:
  clients:
    default:
      uri: mongodb+srv://<username>:<password>@cluestername.11111.mongodb.net/<database_name>?authMechanism=SCRAM-SHA-1&authSource=<database_name>&retryWrites=true&w=majority
      options:
        server_selection_timeout: 5
        ssl: true
  1. Setup devise.
  2. On MongoDB Atlas allow IP connections from anywhere.

Error displayed:

The DNS query returned no SRV records for %hostname

Things that i've tried:

  • Test connection with a new cluster. (Did not work)

0 Answers0