Coder Social home page Coder Social logo

Comments (8)

bkeepers avatar bkeepers commented on July 22, 2024 1

I haven't used capistrano for a while, but I'm guessing there is some kind of hook that it could use. Otherwise, you could just do it manually:

require 'dotenv'
Dotenv.load

from dotenv.

nnc avatar nnc commented on July 22, 2024

I had the same problem with Capistrano 2 as @jherdman described, but it turns out the only problem was I blindly followed instructions in the README to add

gem 'dotenv-rails', :groups => [:development, :test]

to Gemfile. Once I removed the groups part, everything is working as advertised.

from dotenv.

bkeepers avatar bkeepers commented on July 22, 2024

@nnc thanks for the report! Can you try upgrading to the latest, which pulls capistrano support into https://github.com/bkeepers/dotenv-deployment.

from dotenv.

nnc avatar nnc commented on July 22, 2024

@bkeepers I think I already have the latest dotenv and dotenv-deployment, as I installed it all yesterday.

from dotenv.

nnc avatar nnc commented on July 22, 2024

@bkeepers I just checked to make sure I have the latest of all 3 gems:

$ bundle list|grep dotenv
  * dotenv (0.11.1)
  * dotenv-deployment (0.0.2)
  * dotenv-rails (0.11.1)

However, I now see I completely missed the part about adding 'dotenv-deployment' to Gemfile, in the dotenv-deployment README. I saw dotenv-deployment was installed as a dependency of dotenv, so I thought I'm all set there.

Are there any downsides to having just

gem 'dotenv-rails'

in the Gemfile, as opposed to

gem 'dotenv-rails', :groups => [:development, :test]
gem 'dotenv-deployment'

as instructed by READMEs?

from dotenv.

bkeepers avatar bkeepers commented on July 22, 2024

dotenv-deployment will be removed as a dependency of dotenv in the next release (1.0).

I will update the docs for dotenv-deployment for 1.0 to just have:

gem 'dotenv-deployment'

from dotenv.

nnc avatar nnc commented on July 22, 2024

@bkeepers docs for dotenv-deployment already say that, but docs for dotenv-rails say you should put it only in development and test groups.

So docs are actually already correct, one just needs to follow both of them precisely. The problem I had was simply because I didn't do that.

Thanks for dotenv btw!

from dotenv.

jherdman avatar jherdman commented on July 22, 2024

Oh boy. I didn't realize there was a dotenv-deployment. That definitely explains my issue! I looked into it this morning, but I don't think it's flexible enough to meet my needs (it looks for .env.* in the wrong place for my application).

I'm happy with closing this issue unless there's an action item that be generated from this still.

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.