A
A
Anton Misyagin2015-12-09 11:18:18
linux
Anton Misyagin, 2015-12-09 11:18:18

How to find out with what environment a command is launched?

backup -v

Backup 4.2.0

$PATH
-bash: /home/deployer/.rvm/gems/ruby-2.1.5/bin:/home/deployer/.rvm/gems/[email protected]/bin:/usr/share/rvm/rubies/ ruby-2.1.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: /usr/share/rvm/bin: No such file or directory

env -i backup -v
env: backup: No such file or directory
env -i PATH=/home/deployer/.rvm/gems/ruby-2.1.5/bin:/home/deployer/.rvm/gems/ruby- [email protected]/bin:/usr/share/rvm/rubies/ruby-2.1.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ sbin:/bin:/usr/games:/usr/local/games:/usr/share/rvm/bin backup -v
/usr/share/rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1 .0/rubygems/dependency.rb:315:in `to_specs': Could not find 'backup' (>= 0) among 14 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/.gem/ruby /2.1.0:/usr/share/rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0', execute `gem env` for more information
from /usr/share/rvm/rubies/ruby -2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:324:in `to_spec'
from /usr/share/rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:58:in `gem'
from /home/deployer/.rvm/gems /ruby-2.1.5/bin/backup:22:in `'
from /home/deployer/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
from /home/deployer/.

rvm/gems/ruby-2.1.5/bin/ ruby_executable_hooks :15:in `' I conclude that the matter is not only in the ways. Hence the question in the thread title.
The origins of the question come from my threads:
How to apt-get update from a shell script?
How to run ruby ​​gems through capistrano?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-12-09
@BuriK666

in /proc/<pid>/environyou can see the ENV of the running process.
cat /proc/<pid>/environ | tr \\0 \\n

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question