title: Don't know how to build task 'bundle' - Ruby on Rails
body: <p>I am trying to precompile my assets:</p>
  
  <pre><code>rake assets:precompile RAILS_ENV=production bundle exec rake assets:precompile
  </code></pre>
  
  <p>and getting the following error: </p>
  
  <blockquote>
    <p>Don't know how to build task 'bundle' (See the list of available tasks with "rake --tasks")</p>
  </blockquote>
  
  <p>After <code>--trace</code>:</p>
  
  <pre><code>** Invoke assets:precompile (first_time)
  ** Invoke assets:environment (first_time)
  ** Execute assets:environment
  ** Invoke environment (first_time)
  ** Execute environment
  ** Invoke yarn:install (first_time)
  ** Execute yarn:install
  yarn install v1.17.3
  [1/4]   Resolving packages...
  success Already up-to-date.
  ✨  Done in 0.04s.
  ** Execute assets:precompile
  rake aborted!
  Don't know how to build task 'bundle' (See the list of available tasks with `rake --tasks`)
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task_manager.rb:59:in `[]'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:159:in `invoke_task'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
  /Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/exe/rake:27:in `&lt;top (required)&gt;'
  /Users/anton/.rbenv/versions/2.6.3/bin/rake:22:in `load'
  /Users/anton/.rbenv/versions/2.6.3/bin/rake:22:in `&lt;main&gt;'
  </code></pre>
  
  <p>How to fix this problem? I tried to update my gems, re-installed everything, added <code>gem 'rake'</code> and still getting the same error. Thank you very much for your help.</p>
  
  <p>Rails version: <code>~&gt; 5.1.6</code></p>