title: Merging hashes in Ruby not working as intended
body: <p>I'm trying to reproduce an example in a Ruby tutorial of merging two hashes. However, using the "merge" method does not have the desired effect. When I run the following script:</p>
  
  <pre><code>capitals={'New York' =&gt; 'Albany','California' =&gt; 'Sacramento'}
  more_capitals={'Texas' =&gt; 'Austin', 'Alaska' =&gt; 'Fairbanks'}
  
  capitals.merge(more_capitals)
  
  capitals.each do |state,capital|
      puts "#{capital} is the capital of #{state}"
  end
  </code></pre>
  
  <p>I get this result:</p>
  
  <pre><code>Albany is the capital of New York
  Sacramento is the capital of California
  </code></pre>
  
  <p>(see also screen grab from repl.it below). I would however also expect the output to contain "Austin is the capital of Texas" and "Fairbanks is the capital of Alaska" if the merging of the "capitals" and "more_capitals" hashes were carried out correctly. Why is this not the case?</p>
  
  <p><a href="https://i.stack.imgur.com/JT2WD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JT2WD.jpg" alt="enter image description here"></a></p>