Do you actually want to modify the music data in the file with replaygain value? Only one of the replaygain values can be applied at a time and the process is lossy (irreversible). You should only write to the tag and have the player choose which value to playback with.
Foobar2000 can write the values to the tag or modify the music data permanently.
Foobar doesn't know when you rip a cd with another application, so you have to scan manually I guess.
Select all, right click, Replay Gain, Scan Selection as Albums (by tags), done.
If you rip to wav and use foobar to convert to flac, mp3 etc. you can also set up a custom conversion profile, and check the "ReplayGain-scan output files as albums" option on page 3 of the Converter Setup.