Shim to load environment variables from .env into ENV in development. Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables. But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. dotenv loads variables from a .env file into ENV when the environment is bootstrapped. dotenv is initialized in your Rails app during the before_configuration callback, which is fired when the Application constant is defined in config/application.rb with class Application < Rails::Application. If you need it to be initialized sooner, you can manually call Dotenv::Railtie.load.

Features

  • Add your application configuration to your .env file in the root of your project
  • You can double quote strings
  • Multi-line values with line breaks are now supported for quoted values
  • dotenv was originally created to load configuration variables into ENV in development
  • Some find dotenv to be a convenient way to configure Rails applications in staging and production environments

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow dotenv

dotenv Web Site

Other Useful Business Software
DataHub is the leading open-source data catalog helping teams discover, understand, and govern their data assets. Icon
DataHub is the leading open-source data catalog helping teams discover, understand, and govern their data assets.

Modern Data Catalog and Metadata Platform

Built on an open source foundation with a thriving community of 13,000+ members, DataHub gives you unmatched flexibility to customize and extend without vendor lock-in. DataHub Cloud is a modern metadata platform with REST and GraphQL APIs that optimize performance for complex queries, essential for AI-ready data management and ML lifecycle support.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of dotenv!

Additional Project Details

Programming Language

Ruby

Related Categories

Ruby Software Development Software

Registered

2021-09-21