LSAPI warnings
At least for the ENV problem, I presume it appears because you are adding some LiteSpeed specific values to ENV. If you are doing this in Ruby, just wrap your constant resetting with this code:
old_verbose, $VERBOSE = $VERBOSE, nil
(set constant here)
$VERBOSE = old_verbose...