Skip to content

Dotenv.load call causes Rails app to be loaded twice #442

@thisismydesign

Description

@thisismydesign

Steps to reproduce

We had the following historical setup.

Gemfile

group :development, :test do
  gem 'dotenv-rails'
end

application.rb

if File.exist?('.env')
  require 'dotenv'
  Dotenv.load
end

Even though the application.rb part is not needed when using with rails, I wouldn't expect this setup to reload the whole app.

Expected behavior

Dotenv.load doesn't load the whole rails app.

System configuration

dotenv version: 2.7.6

Rails version: 7.0.1

Ruby version: 3.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions