Questions tagged [env]

221 questions
2
votes
1 answer

linux env command does not work as expected?

These 2 lines work as expected: $ env NEW=hello bash -c "env | grep hello" NEW=hello $ env NEW=hello bash -c "echo $PATH" /bin:/usr/bin But I don't know why the following does not work (as expected). $ env NEW=hello bash -c "echo $NEW" Any…
M S
  • 21
  • 2
2
votes
1 answer

Vagrant-env plugin throwing error - line "VAR_NAME=var_value" doesn't match format

I have ruby 2.1.5 installed on Ubuntu with Vagrant 1.7 I ran: ~$ vagrant plugin install vagrant-env as described at gosuri/vagrant-env. I should also mention that this now only works when I add: require 'dotenv' Dotenv.load which the doc (README)…
earth2jason
  • 715
  • 1
  • 9
  • 20
2
votes
1 answer

Using .ENV value in NodeJS, Required Key Error in Procfile Definition

I am trying to use the foreman package to see if the way I setup my .env file will work with use in one of my JS files, but when I run nf start server.js I receive the following warnings and then the server never starts. I thought it was related to…
cphill
  • 5,596
  • 16
  • 89
  • 182
2
votes
1 answer

Rails: can Zeus read the .env file?

I'm using Zeus to pre-load my Rails environment as a replacement for developing with Foreman. But Zeus isn't picking up values from my .env file. Is it possible for Zeus to do this?
Ollie Glass
  • 19,455
  • 21
  • 76
  • 107
2
votes
1 answer

Run python script from python using different python

I have a software that has python 2.5.5. I want to send a command that would start a script in python 2.7.5 and then proceed with the script. I tried using #!python2.7.5 and http://redsymbol.net/articles/env-and-python-scripts-version/ But I cant…
Dariusz
  • 960
  • 13
  • 36
2
votes
1 answer

retrieve user path environment variable

I try to retrieve the path environment variable on Windows. Therefore, I tried #include #include using namespace std; int main() { char* path = getenv("Path"); cout << "current path is:" << path << endl; cin.get(); //…
Max Beikirch
  • 2,053
  • 5
  • 25
  • 36
2
votes
2 answers

Rails + SendGrid Unauthenticated senders not allowed

I'm currently working on sending emails via sendgrid and currently sending emails to new users is working. ...But strangely, very similar emailing options aren't working - the full email including the recipient is displayed in the log but is never…
limasxgoesto0
  • 4,555
  • 8
  • 31
  • 38
2
votes
5 answers

Looking to get the env vars of a PID in BASH for a BASH script

Any way to do this? I have a script that exports a few vars and runs a component. I'm looking to find out the actual values of some of these vars while the process is running. (Which applies here, because I'll be incorporating those values into…
Monster
  • 1,573
  • 6
  • 23
  • 35
2
votes
3 answers

why does setting an initial environment using env stall the launch of my Python script on Ubuntu?

I have a test script, e.g. "test.py", and I want to make it so that it executes with a particular environment variable set before the script begins: #!/usr/bin/env TEST=anything python print "Hello, world." Running this normally works as…
Steve
  • 8,153
  • 9
  • 44
  • 91
1
vote
2 answers

What's the best way to get the hostname from the env hash in a Rails app?

I'm writing an OmniAuth dynamic provider and in the callback I need to get the current hostname (the app works in several different hostnames). I don't have the request object, just a big env hash. I found this hash contains an entry,…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
3 answers

bash: set environment variable out of find's exec

I would like to find all directories in the current working directory and its subdirectories, that are either the root of a git repository, or not tracked by git at all. To do so I wrote this bash script: #!/bin/bash export FOUND_UNTRACKED=0 export…
kkraemer
  • 13
  • 1
  • 3
1
vote
1 answer

sudo has different environments, why?

I realize that: sudo -i env is different from: sudo -i sudo env They are both sudo, why are they different? In my case, I realize the PATHs are very different, so sometimes things can't run with "sudo blah" but it works when I first log into sudo,…
foobar
  • 10,854
  • 18
  • 58
  • 66
1
vote
1 answer

Why can I echo an environment variable but not use it to cd or ls?

How come I can echo the $RUBYPATH variable: [grant@rails-box app]$ echo $RUBYPATH /opt/rubies/ruby-2.3.0 And ls that directory: [grant@rails-box app]$ ls /opt/rubies/ruby-2.3.0 bin include lib share But I can't ls using the…
gh4x
  • 818
  • 1
  • 10
  • 16
1
vote
1 answer

How to pass the system environment variable to nginx.conf

My question is how to pass the system environment variable to nginx.conf? I define a system variable CLASSPATH in /etc/profile: export CLASSPATH=$CLASSPATH:$HADOOP_HOME/bin/hadoop classpath --glob And I define tow variables in nginx.conf: env…
Chunhui Zhang
  • 133
  • 2
  • 7
1
vote
2 answers

Laravel 5 - How can I set more than 1 database credentials for the same laravel project (if it is possible)?

I have a project that must to be accessed through these 2 URLs us_myproject.com and es_myproject.com. They share the same folders and code. In fact there are only one laravel project: htdocs/myproject. depending on URL the information must to come…
IgorAlves
  • 5,086
  • 10
  • 52
  • 83