title: How to use the attach gem in rails 5
body: <p>My environment:</p>
  
  <ul>
  <li>Ruby 2.4.1 </li>
  <li>Rails 5.1.4</li>
  </ul>
  
  <p>I am trying to use the attach gem, written by the person who also wrote this article <a href="https://atech.blog/atech/file-attachments-in-rails-tutorial" rel="nofollow noreferrer">https://atech.blog/atech/file-attachments-in-rails-tutorial</a>.</p>
  
  <p>When I run the bundle install it installs attach gem, version 1.0.2</p>
  
  <p>Then when I try to run the rake command I get an error saying it does not know how to build the task.</p>
  
  <pre><code>rake attach:install:migrations --trace
  
  rake aborted!
  Don't know how to build task 'attach:install:migrations' (see --tasks)
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/task_manager.rb:59:in `[]'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:159:in `invoke_task'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `block (2 levels) in top_level'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `each'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:116:in `block in top_level'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:125:in `run_with_threads'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:110:in `top_level'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:83:in `block in run'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:186:in `standard_exception_handling'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/lib/rake/application.rb:80:in `run'
  /usr/local/rvm/gems/ruby-2.4.1/gems/rake-12.3.0/exe/rake:27:in `&lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.4.1/bin/rake:23:in `load'
  /usr/local/rvm/gems/ruby-2.4.1/bin/rake:23:in `&lt;main&gt;'
  /usr/local/rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  </code></pre>
  
  <p>Any ideas on what the error is? I am wondering if I am missing a required gem to make it work. The link to the attach documentation is <a href="https://github.com/adamcooke/attach" rel="nofollow noreferrer">https://github.com/adamcooke/attach</a></p>