Agree with @Ernest; it should work. Here's a sample...
Sample rake task to echo vars:
task :echo_env do
puts "VAR1: #{ENV['VAR1']}"
puts "VAR2: #{ENV['VAR2']}"
end
Execute task:
VAR1=first VAR2=second bundle exec rake echo_env
Output:
VAR1: first
VAR2: second