Calculating protein mass
About your code:


I am glad you liked the idea of building the inverse structure programmatically, but here I don't think it's necessary :) Only two aminoacids have the same weight, I'd write the reversed hash. 
Why residue instead of aminoacid?
I don't see why you need take_while here.
xs.reduce(0) { |acc, x| acc.method(x) } -> xs.reduce(0, :method).
Minor detail: personally I prefer explicit uses of $stdin.readline instead of gets.


I'd write:

module Rosalind
  MONOISOTOPIC_MASS_BY_AMINOACID = {
    "A" =&gt; 71.03711,
    "C" =&gt; 103.00919,
    "D" =&gt; 115.02694,
    "E" =&gt; 129.04259,
    "F" =&gt; 147.06841,
    "G" =&gt; 57.02146,
    "H" =&gt; 137.05891,
    "I" =&gt; 113.08406,
    "L" =&gt; 113.08406,
    "K" =&gt; 128.09496,
    "M" =&gt; 131.04049,
    "N" =&gt; 114.04293,
    "P" =&gt; 97.05276,
    "Q" =&gt; 128.05858,
    "R" =&gt; 156.10111,
    "S" =&gt; 87.03203,
    "T" =&gt; 101.04768,
    "V" =&gt; 99.06841,
    "W" =&gt; 186.07931,
    "Y" =&gt; 163.06333,
  }

  def self.problem_prtm(aminoacids_string)
    aminoacids_string.
      chars.
      map { |aminoacid| MONOISOTOPIC_MASS_BY_AMINOACID[aminoacid] }.
      reduce(0, :+)
  end  
end 

protein = $stdin.readline.rstrip
weight = '%.3f' % Rosalind.problem_prtm(protein)
puts(weight)


Same idea, slightly different approach:

module Rosalind
  ...
  def self.problem_prtm(aminoacids_string)
    aminoacids = aminoacids_string.chars
    masses = MONOISOTOPIC_MASS_BY_AMINOACID.values_at(*aminoacids)
    masses.reduce(0, :+)
  end
end