I need to shell out to a process while setting an environment variable for it. I tried this one-liner:
system \"RBENV_VERSION=system ruby extconf.rb\"
Actually that worked for me.
shai@comp ~ » irb 1.9.3p0 :001 > system %{SHAIGUITAR=exists ruby -e 'puts ENV["SHAIGUITAR"]'} exists => true
But if it doesn't, maybe you can try prepending "env" to whatever variable you need. E.g.
system(%{env SHAIGUITAR=exists ruby bla.rb})