title: LoadError: Could not load the 'listen' gem (Rails 5)
body: <p>I've got an API mode Rails 5 app that won't let me run <code>rake routes</code> or <code>rails s</code>. The error I get is:</p>
  
  <pre><code>$ rake routes
  rake aborted!
  LoadError: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile
  .../config/environment.rb:5:in `&lt;top (required)&gt;'
  LoadError: cannot load such file -- listen
  .../config/environment.rb:5:in `&lt;top (required)&gt;'
  Tasks: TOP =&gt; routes =&gt; environment
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>I've verified that <code>listen</code> is in the development group in my Gemfile:</p>
  
  <pre><code>group :development do
    gem 'listen', '~&gt; 3.1.5'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
  end
  </code></pre>
  
  <p>And that it's in my Gemfile.lock:</p>
  
  <pre><code>$ cat Gemfile.lock | grep 'listen'
      listen (3.1.5)
      spring-watcher-listen (2.0.0)
        listen (&gt;= 2.7, &lt; 4.0)
    listen (~&gt; 3.1.5)
    spring-watcher-listen (~&gt; 2.0.0)
  </code></pre>
  
  <p>I've bundle updated, and bundle installed, and verified that <code>gem install listen</code> works. This was working earlier this week, but I'm not having luck going back through my commits. </p>
  
  <pre><code>$ ruby -v
  ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
  </code></pre>
  
  <p>I don't see it in <code>vendor/cache</code> but I'm not sure what to make of that...</p>
  
  <pre><code>$ bundle package | grep 'listen'
  </code></pre>
  
  <p>Appreciate the help!</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I can "fix" the problem by putting <code>gem 'listen', '~&gt; 3.1.5'</code> in the global Gemfile (and removing it from <code>:development</code>). Then all the errors go away and everything works, but that seems wrong.</p>