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
It will prevent the warning from appearing. The equivalent in C should be pretty similar (other than the parallel assignment).