Skip to content

Psych::AliasesNotEnabled: Alias parsing was not enabled. To enable it, pass aliases: true to Psych::load or Psych::safe_load. #725

@brunoarueira

Description

@brunoarueira

I have the following config/mongo.yml:

defaults: &defaults
  host: 127.0.0.1:27017
  options:
    w: 1
    pool_size: 1
    slave_ok: false
    ssl: false

development:
  <<: *defaults
  database: example_mongodb_development

test:
  <<: *defaults
  database: example_mongodb_test
  w: 0

# set these environment variables on your prod server
production:
  <<: *defaults
  database: example_mongodb
  username: <%= ENV['MONGO_USERNAME'] %>
  password: <%= ENV['MONGO_PASSWORD'] %>

I'd resolved to upgrade the app to ruby 3 and the default initializer from the mongomapper gem doesn't comply with a need for psych to pass an option called aliases with true as value, causing the error from the title.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions