title: Should I specify exact versions in my Gemfile?
body: <p>I've noticed that on rubygems.org a lot of the gems suggest you specify them by major version rather than exact version. For example...</p>
  
  <p><a href="http://rubygems.org/gems/haml-rails" rel="noreferrer">The haml-rails gem</a>...</p>
  
  <pre><code>gem "haml-rails", "~&gt; 0.3.4"  # "$ bundle install" will acquire the 
                                # latest version before 1.0.
  </code></pre>
  
  <p>However, based on the <a href="https://bundler.io/guides/using_bundler_in_applications.html#adding-gems" rel="noreferrer">Bundler docs</a> it sounded to me like it would be better to nail down the exact version like this...</p>
  
  <pre><code>gem "haml-rails", "0.3.4"
  </code></pre>
  
  <p>So there's your haml-rails gem and all its dependencies won't drift forward. If you check out the project on a different machine a few weeks later and run <code>$ bundle install</code> you'll have precisely the same versions of everything you specified.</p>
  
  <p>I've seen point releases break stuff, and I thought part of the whole idea of Bundler was to "<code>Bundle.lock</code>" all your gem versions.</p>
  
  <p>But on rubygems.org they use "~>" a lot so maybe I'm missing something?</p>
  
  <p>Any clarification would be very helpful to me in understanding Bundler and gem management.</p>