title: Rake 12.3 still produces NoMethodError: undefined method 'last_comment'
body: <p><a href="https://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11">NoMethodError: undefined method `last_comment&#39; after upgrading to rake 11</a></p>
  
  <p>I have been encountering the problem described in the thread above. To recap, running <code>rake</code> produces the following error:</p>
  
  <pre><code>NoMethodError: undefined method `last_comment' for #&lt;Rake::Application:0x00000002b15ba0&gt;
  </code></pre>
  
  <p>The consensus in the thread above is that the 'last_comment' method is deprecated in <code>rake 11</code> (replaced by 'last_description'). </p>
  
  <p>The answers claim the solution is to either pin <code>rake</code> to version 10.5 in the Gemfile, which still calls 'last_comment', or upgrade to <code>rake 12</code> and <code>rspec &gt;3.5</code>, where the dependency has been resolved. I've tried both solutions, and I still get the same error.</p>
  
  <p><strong>Update</strong>
  The <code>bundle exec</code> trace suggests that <code>rake</code> is using the system gem for <code>rspec</code>, which is only 2.9. How do I either upgrade the system gem or get the bundler to recognize the version I've specified in my gem path?</p>
  
  <p><strong>Gemfile</strong></p>
  
  <pre><code>gem "rake"
  gem "rspec", '&gt;= 3.7'
  </code></pre>
  
  <p><strong>Gemfile.lock</strong></p>
  
  <pre><code>GEM
  
  remote: https://rubygems.org/
    specs:
      diff-lcs (1.3)
      rake (12.3.0)
      rspec (3.7.0)
        rspec-core (~&gt; 3.7.0)
        rspec-expectations (~&gt; 3.7.0)
        rspec-mocks (~&gt; 3.7.0)
      rspec-core (3.7.1)
        rspec-support (~&gt; 3.7.0)
      rspec-expectations (3.7.0)
        diff-lcs (&gt;= 1.2.0, &lt; 2.0)
        rspec-support (~&gt; 3.7.0)
      rspec-mocks (3.7.0)
        diff-lcs (&gt;= 1.2.0, &lt; 2.0)
        rspec-support (~&gt; 3.7.0)
      rspec-support (3.7.1)
  
  PLATFORMS
    ruby
  
  DEPENDENCIES
    rake
    rspec (&gt;= 3.7)
  
  BUNDLED WITH
     1.16.1  
  </code></pre>
  
  <p><strong>Versions</strong></p>
  
  <pre><code>ruby 2.3.1
  Rails 4.2.6
  rake, version 12.3.0
  RSpec 3.7
    - rspec-core 3.7.1
    - rspec-expectations 3.7.0
    - rspec-mocks 3.7.0
    - rspec-rails 3.7.2
    - rspec-support 3.7.0
  </code></pre>
  
  <p><strong>Traces</strong></p>
  
  <p>When I run <code>rake</code>:</p>
  
  <pre><code>/var/lib/gems/2.3.0/gems/rspec-core-2.99.2/lib/rspec/core/rake_task.rb:143:in `initialize'
  /home/alexander/Documents/Coding/Ruby/learn_ruby/Rakefile:8:in `new'
  /home/alexander/Documents/Coding/Ruby/learn_ruby/Rakefile:8:in `&lt;top (required)&gt;'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/exe/rake:27:in `&lt;top (required)&gt;'
  /usr/local/bin/rake:23:in `load'
  /usr/local/bin/rake:23:in `&lt;main&gt;'
  </code></pre>
  
  <p>When I run <code>bundle exec rake</code>:</p>
  
  <pre><code>Gem::LoadError: can't activate rspec (~&gt; 2), already activated rspec-3.7.0. Make sure all dependencies are added to Gemfile.
  /var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/rubygems_integration.rb:404:in `block (2 levels) in replace_gem'
  /home/alexander/Documents/Coding/Ruby/learn_ruby/Rakefile:2:in `&lt;top (required)&gt;'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/rake_module.rb:29:in `load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:703:in `raw_load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:104:in `block in load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:103:in `load_rakefile'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:82:in `block in run'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
  /var/lib/gems/2.3.0/gems/rake-12.3.0/exe/rake:27:in `&lt;top (required)&gt;'
  /usr/local/bin/rake:23:in `load'
  /usr/local/bin/rake:23:in `&lt;main&gt;'
  </code></pre>
  
  <p>When I just run <code>bundle</code>:</p>
  
  <pre><code>Using rake 12.3.0
  Using bundler 1.16.1
  Using diff-lcs 1.3
  Using rspec-support 3.7.1
  Using rspec-core 3.7.1
  Using rspec-expectations 3.7.0
  Using rspec-mocks 3.7.0
  Using rspec 3.7.0
  </code></pre>
  
  <p>When I run <code>bundle show rspec-rails</code>, it says that it could not find the gem.</p>