Coder Social home page Coder Social logo

Comments (5)

bkeepers avatar bkeepers commented on July 22, 2024 1

You can, or you can put something like this after Bundler.require in config/application.rb:

Dotenv.overload ".env.#{Rails.env}"  # or "config/environments/#{Rails.env}.env}"

from dotenv.

rwz avatar rwz commented on July 22, 2024

I don't know if that's the right place to complain but me and lots of other developers I've introduced to dotenv use it for development AND test environments.

I guess that the biggest issue that led to dotenv-deployment was people adding dotenv to gemfile without test/dev grouping and then getting weird behavior in production and spending a lot of time debugging it.

I think dotenv should work in development AND test by default and do nothing in production. It's frustrating to add a separate gem of write glue-code to get the same behavior in test you already have in development. I also can't imagine a situation where you do need dotenv in development, and not in test by default.

from dotenv.

jjb avatar jjb commented on July 22, 2024

I agree with @rwz

from dotenv.

jjb avatar jjb commented on July 22, 2024

@bkeepers any thoughts on what @rwz wrote?

from dotenv.

bkeepers avatar bkeepers commented on July 22, 2024

You could easily add this in your spec_helper.rb or test_helper.rb:

Dotenv.load(".env.test")

from dotenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.