HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
bkeepers
dotenv
Ruby2014–2022
bkeepers / dotenv

dotenv

A Ruby gem to load environment variables from `.env`.

7Distinct people
7Mentions
0Explicit recommenders
6.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A Ruby gem to load environment variables from `.env`.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year7 dated mentions

Observed mentions: 2014-03-17 01:06:46 UTC to 2022-03-23 15:29:36 UTC.

0122014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC101
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

What Hacker News says

7 sources
> NOTICE: cross-env still works well, but is in maintenance mode. Which is why I recently kicked all the cross-env out of my nodejs projects and replaced it with Ruby's dotenv[0] (in projects that already used ruby alongside) and zenv[1], in Rust for projects that don't. Basically "start": "zenv --file .env.production -- node ./index.js" [0] https://github.com/bkeepers/dotenv [1] https://lib.rs/crates/zenv (readenv is an alternative, but that doesn't allow overriding the .env file)
In Dum: An NPM scripts runner written in Rust
Unfortunately, there is tooling, and a subculture that builds tooling, that uses configuration files in the same directory as the source code. Say you're deploying with cool-deploy-tool. cool-deploy-tool finds the password for the server by looking for a file called "Coolfile" in the project root. You have to create that file to use it. Now you have a footgun lying around. I associate this stuff with the Ruby community, but it's spread far and wide, notably to the Node and Go communities, which i think have large Ruby emigrant populations. As a prototypal example, consider dotenv, which began in Ruby: https://github.com/bkeepers/dotenv And has travelled to Node: https://github.com/motdotla/dotenv And Go: https://github.com/joho/godotenv
In RFC 8959: The “secret-token” URI Scheme
I always use environment variables, you can just use ENV['AWS_S3_KEY'] or whatever in your application code. Keep the keys in your local environment, and add separate sets of keys to the staging / production environments. These files probably live in your project (.env or similar) in development but are gitignored. On production, they can be in your web-server or application configuration wherever appropriate, as long as they get loaded. If you are using a tool to manage deployment, you probably just need a step to verify on deploy the files / lines containing keys exist. I can't think of a widely-used programming language that doesn't support environment variables, though support may be less than exemplary in your language of choice. In ruby land, I use https://github.com/bkeepers/dotenv
In Web Developer Security Checklist
Certainly everything in moderation - I only give letters to commands I literally type hundreds of times daily. Over the past 10 years, I've accumulated 5: b=`bundle exec`, though this is becoming less often used and I may remove it d=dotenv to easily wrap a command in environment variables (https://github.com/bkeepers/dotenv) g=git h=hub (GitHub's extensions to Git) j=autojump to move to common directories using just a few characters from their name (https://github.com/wting/autojump)
In Show HN: Git alias commands and shortcuts
The implementation varies depending on your framework and personal preferences. For development, I usually use a file named .env in the same directory as my project, and then do whatever I can to guarantee that this file won't be added to my repo (or other public places). I use .gitignore_global to exclude .env files, for instance. For production, if you're running your app on a service like Heroku, they have commands you can execute to securely set environment variables on their server (since they discourage accessing the filesystem to load the .env file). For Rails, take a look at the dotenv-rails gem. It's pretty convenient. https://github.com/bkeepers/dotenv Here is the Heroku article on the topic (might not apply directly to your situation, but the principal is key): https://devcenter.heroku.com/articles/config-vars
In Production AWS keys on GitHub

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.