OSS Tanbou

load .env values into Ruby ENV and keep development and test configuration out of application source code

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
6,764
Primary language
Ruby
License
MIT
Repository last updated
Jun 22, 2026
On this page

Overview

dotenv is a Ruby library that loads values from .env files into ENV during application startup. Rails loads it automatically, while plain Ruby applications can use dotenv/load or Dotenv.load. It is primarily useful for keeping environment-specific development and test configuration out of source code.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Load .env files while preserving environment-variable precedence

By default dotenv loads .env from the current working directory. When multiple files are supplied, the first value set wins, and existing environment variables are not overwritten unless overwrite behavior is explicitly enabled.

Sources: [1]

Restore ENV in Rails tests and validate required keys

Rails integration can restore ENV after each test in dotenv 3.x, and Dotenv.require_keys can fail during initialization when required configuration is missing.

Sources: [1]

Best fit

Fits shared configuration keys across development, test, and CI

Ruby and Rails projects can keep the same environment-variable names while assigning different values in each development or test environment.

Sources: [1]

Before adoption

Do not commit .env files containing unnecessary secrets

The README recommends limiting credentials to machines that need them and avoiding repository commits of sensitive values that are not required by every development machine or server.

Sources: [1]

Evaluate platform configuration and secrets tooling for production

dotenv was originally designed to load environment variables in development. Production deployments should compare .env distribution with operating-system, platform, or secrets-management mechanisms already available.

Sources: [1]

Use Ruby 3.0 or later with v3.2.0

The v3.2.0 gemspec requires Ruby 3.0 or later. As of October 3, 2026, v3.2.0 is the latest stable release, so projects on older Ruby runtimes should verify release-line compatibility.

Sources: [2][3]

Official sources

  1. [1]dotenv v3.2.0 README(2026-10-03)
  2. [2]dotenv v3.2.0 gemspec(2026-10-03)
  3. [3]dotenv v3.2.0 release(2026-10-03)
  4. [4]dotenv MIT license(2026-10-03)
Supplemental curator note

Treat .env as a configuration convenience rather than a secrets-management system. Separate development settings from production credential management and define which .env files, if any, are safe to commit.

Try it in 3 steps

  1. 1

    Install dotenv 3.2.0

    Pin the stable release in a Ruby 3.0 or newer environment. Use the same version in the Gemfile when working with Bundler.

    gem install dotenv -v 3.2.0
  2. 2

    Create a .env file without real secrets

    Use only a harmless demonstration value and do not commit real credentials to the repository.

    echo 'OSS_TANBOU_DEMO=hello' > .env
  3. 3

    Load .env and read the value

    Load .env into ENV at startup through dotenv/load and confirm that hello is printed.

    ruby -rdotenv/load -e 'puts ENV.fetch("OSS_TANBOU_DEMO")'
Check the official README

Growth

Growth trends · Last 30 days

6,764 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
6

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • dotenv
  • ruby
Stars
6,764
Forks
516
Watchers
69
Open issues
13
Contributors
115
Owner type
User
Primary language
Ruby
License
MIT
Repository last updated
Jun 22, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?