From: Esen Sagynov Date: 2010-08-04T11:52:07+09:00 Subject: Re: ENV['someapp']" is nil when the code is run with "sudo" I have solved it for my personal case with -E flag after sudo like "sudo -E gem install cubrid". But anyway, this is not something I want, because I do not want the global users of my gem to type this -E flag all the time the need to install my gem. I looked at other gems how they solve this problem, as I can install them without -E. For instance, I have attached the sample code found in mysql's extconf.rb file, which somehow deals with this problem as it also extracts ENV['PATH'] variable, just like me. But when installing mysql, I do not need to type -E. I saw in mysql's code it adds the -E flag to the cpp_command and prints it out to the "system", but somehow I cannot replicate it. I have posted in the RubyGem Help (http://help.rubygems.org/discussions/problems/256-gem-install-mygem-does-not-install-the-gem), haven't still found the solution. Anyway, thank you Brian. If you think you can have time to look at that pure Ruby code to see how does it add that -E flag runtime, it would help me a lot. Have a good day! -- Posted via http://www.ruby-forum.com/.