env

Setting environment variables for Phusion Passenger applications

醉酒当歌 提交于 2019-12-04 06:21:09
I've set up Passenger in development (Mac OS X) and it works flawlessly. The only problem came later: now I have a custom GEM_HOME path and ImageMagick binaries installed in "/usr/local" . I can put them in one of the shell rc files that get sourced and this solves the environment variables for processes spawned from the console; but what about Passenger? The same application cannot find my gems when run this way. I know of two solutions. The first (documented here ) is essentially the same as manveru's—set the ENV variable directly in your code. The second is to create a wrapper around the

What's the difference of using #!/usr/bin/env or #!/bin/env in shebang?

雨燕双飞 提交于 2019-12-04 01:34:17
Will there be any difference or it's just a personal choice? #!<interpreter> <arguments> tries to run <interpreter> <arguments> to read and run the rest of the file. So #!/usr/bin/env means that there must be a program called /usr/bin/env ; #!/bin/env means that there must be a program called /bin/env . Some systems have one and not the other. In my experience, most have /usr/bin/env , so #!/usr/bin/env is more common. Unix systems will try to run <interpreter> using execve , which is why it must be a full path, and #!env without a path will not work. Mikel explanation is great, it misses just

Dockerfile - set ENV to result of command

让人想犯罪 __ 提交于 2019-12-03 06:10:50
问题 Is it possible to set a docker ENV variable to the result of a command? Like: ENV MY_VAR whoami i want MY_VAR to get the value "root" or whatever whoami returns 回答1: As an addition to DarkSideF answer. You should be aware that each line/command in Dockerfile is ran in another container. You can do something like this: RUN export bleah=$(hostname -f);echo $bleah; This is run in a single container. 回答2: I had same issue and found way to set environment variable as result of function by using

Dockerfile - set ENV to result of command

喜欢而已 提交于 2019-12-02 18:41:28
Is it possible to set a docker ENV variable to the result of a command? Like: ENV MY_VAR whoami i want MY_VAR to get the value "root" or whatever whoami returns Dimitrie Mititelu As an addition to DarkSideF answer. You should be aware that each line/command in Dockerfile is ran in another container. You can do something like this: RUN export bleah=$(hostname -f);echo $bleah; This is run in a single container. DarkSideF I had same issue and found way to set environment variable as result of function by using RUN command in dockerfile. For example i need to set SECRET_KEY_BASE for Rails app just

bash_profile is not taking effect with chef-run

梦想的初衷 提交于 2019-12-02 07:24:20
If I run the below recipe with chef, entries are getting added in ~/.bash_profile , but when I do echo $PATH or echo $JAVA_HOME , the command line returns blank values. What's going on there? ruby_block "set-env-java-home" do block do ENV["JAVA_HOME"] = node['java']['path'] ENV['PATH'] = "#{ENV['PATH']}:#{node['java']['path']}/bin" end not_if { $JAVA_HOME == "#{ENV['JAVA_HOME']}" && $PATH = "#{ENV['PATH']}:#{node['java']['path']}/bin" } end bash 'set-env-bashrc' do code <<-EOH echo -e "export JAVA_HOME=$JAVA_HOME" >> ~/.bash_profile echo -e "export PATH=$PATH" >> ~/.bash_profile source ~/.bash

bash_profile is not taking effect with chef-run

痞子三分冷 提交于 2019-12-02 06:52:34
问题 If I run the below recipe with chef, entries are getting added in ~/.bash_profile , but when I do echo $PATH or echo $JAVA_HOME , the command line returns blank values. What's going on there? ruby_block "set-env-java-home" do block do ENV["JAVA_HOME"] = node['java']['path'] ENV['PATH'] = "#{ENV['PATH']}:#{node['java']['path']}/bin" end not_if { $JAVA_HOME == "#{ENV['JAVA_HOME']}" && $PATH = "#{ENV['PATH']}:#{node['java']['path']}/bin" } end bash 'set-env-bashrc' do code <<-EOH echo -e "export

%ENV doesn't work and I cannot use shared library

故事扮演 提交于 2019-12-01 03:16:37
I cannot use %ENV var on my Perl script to use Oracle libs. BEGIN { $ORACLE_HOME = "/usr/lib/oracle/10.2.0.3/client64"; $LD_LIBRARY_PATH = "$ORACLE_HOME/lib"; $ORACLE_SID="prod"; $ENV{ORACLE_SID}=$ORACLE_SID; $ENV{ORACLE_HOME}= $ORACLE_HOME; $ENV{LD_LIBRARY_PATH}= $LD_LIBRARY_PATH; }; If I print $ENV{'ORACLE_HOME'} and $ENV{'LD_LIBRARY_PATH'} all seems ok but, when I run my script I have the error: install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at

%ENV doesn't work and I cannot use shared library

那年仲夏 提交于 2019-11-30 23:44:46
问题 I cannot use %ENV var on my Perl script to use Oracle libs. BEGIN { $ORACLE_HOME = "/usr/lib/oracle/10.2.0.3/client64"; $LD_LIBRARY_PATH = "$ORACLE_HOME/lib"; $ORACLE_SID="prod"; $ENV{ORACLE_SID}=$ORACLE_SID; $ENV{ORACLE_HOME}= $ORACLE_HOME; $ENV{LD_LIBRARY_PATH}= $LD_LIBRARY_PATH; }; If I print $ENV{'ORACLE_HOME'} and $ENV{'LD_LIBRARY_PATH'} all seems ok but, when I run my script I have the error: install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so'

rails 3, how use an ENV config vars in a Settings.yml file?

a 夏天 提交于 2019-11-30 12:37:07
问题 In my settings.yml file I have several config vars, some of which reference ENV[] variables. for example I have ENV['FOOVAR'] equals WIDGET I thought I could reference ENV vars inside <% %> like this: Settings.yml: default: cv1: Foo cv2: <% ENV['FOOVAR'] %> in rails console if I type > ENV['FOOVAR'] => WIDGET but > Settings.cv1 => Foo (works okay) > Settings.cv2 =>nil (doesn't work???) 回答1: use following:- default: cv1: Foo cv2: <%= ENV['FOOVAR'] %> 回答2: The above solution did not work for me

env: python\r: No such file or directory

喜夏-厌秋 提交于 2019-11-30 10:32:38
问题 My Python script beak contains the following shebang: #!/usr/bin/env python When I run the script $ ./beak , I get env: python\r: No such file or directory I previously pulled this script from a repository. What could be the reason for this? 回答1: The script contains CR characters. The shell interprets these CR characters as arguments. Solution: Remove the CR characters from the script using the following script. with open('beak', 'rb+') as f: content = f.read() f.seek(0) f.write(content