Comments (17)
Can you test the latest version (1.0.2) and see if this is still an issue for you? It should be using Rails.root
now to properly require it.
from dotenv.
I'm using dotenv 1.0.2 and having the same issue, even with the initializer
from dotenv.
@PedroSena dotenv 2.0.0 is out now. Can you give that a try and see if you still experience issues?
from dotenv.
Same issue, @bkeepers
from dotenv.
I'm not familiar with how Sidekiq boostraps, so I'd appreciate help looking into the issue. Reopening this issue now.
from dotenv.
I'd recommend setting the env vars when starting up the sidekiq master, rather than relying on the sidekiq process(es) to read in the .env file. It's really not meant for production (partly because of weird edge cases like this).
from dotenv.
I had used Mike Perham's upstart scripts for loading Sidekiq in production and found that I had to add a line to export the env variables before sidekiq loads.
from dotenv.
Leaving dotenv just for dev/test and loading the variables on /etc/environment for production solved the issue. Thanks for the help
from dotenv.
@PedroSena I don't think /etc/environment
is a good place to put project-related
environment variables.
from dotenv.
I am having a similar issue, using Runit with Sidekiq and currently manually sourcing every .env file.
from dotenv.
Jumping a little late on this but hope it can help.
@assimovt do you cd
to your application folder in your Runit config before starting sidekiq?
Here's my capistrano template for a sidekiq runit config:
#!/bin/bash --login
PATH=<%= fetch(:rbenv_path) %>/shims:<%= fetch(:rbenv_path) %>/bin:/usr/local/bin:/usr/bin:/bin
exec 2>&1
cd <%= current_path %> && exec bundle exec sidekiq -e <%= fetch(:rails_env) %>
Works well for me.
from dotenv.
Nobody has any news on that?
I am currently having the same problem, using dotenv and capistrano-sidekiq.
from dotenv.
Actually, it finally worked, with capistrano-sidekiq. Sorry for the noise.
Is this issue still relevant?
from dotenv.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from dotenv.
This is still the case.
from dotenv.
put require 'dotenv/load'
right after require 'bundler/setup'
into bin/sidekiq
from dotenv.
try restarting your sidekiq server. Any changes make to .env are not picked by sidekiq once the service is started.
from dotenv.
Related Issues (20)
- Parse envfile with script proceeds even if the script fails HOT 1
- [PROPOSAL] - Load order - Environment specific vs Global HOT 2
- Environment loading change in 2.7.6 is wrong HOT 7
- [dotenv-rails] .env.local should be loaded in test environments HOT 20
- Spring::MissingApplication HOT 1
- [would be great if] dotenv supported "source" from other envs HOT 1
- `Dotenv::Railtie.overload` violates policy about `env` files priority HOT 3
- Refresh ENV during runtime HOT 2
- Only subset of shell functionality is supported HOT 2
- Ask somthing in docs HOT 1
- Could not find dotenv-2.7.6 in any of the sources HOT 1
- Just HOT 1
- Special characters are being escaped from the value of the environment variables HOT 3
- dotenv-rails loads dev environment when running system tests with Rails 7 HOT 5
- `Dotenv.load` call causes Rails app to be loaded twice HOT 2
- Not specifying required ruby version on Gemfile causes my bundler with ruby 2.5.x pull dotenv 2.8.0 HOT 6
- template is not created in working directory HOT 2
- Question on Removal of ### What other .env* files can I use? FAQ HOT 1
- README should explicitly call out the gem needed is `dotenv-rails` HOT 4
- environment specific env not loaded when using require: 'dotenv/load' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotenv.