title: TypeError: no implicit conversion of Pathname into String
body: <p>I want to use this code to run rake task:</p>
  
  <pre><code>task :backup_and_delete_old_data =&gt; :environment do
        if defined?(Rails)
          require Rails.root + '/config/boot'
        else
          require '../../../config/boot'
        end
        require Rails.root + '/config/environment'
  
        factory_backup.each do |factory_data|
          puts "&gt;&gt; Backup and delete old #{factory_data.to_s.pluralize.humanize} data..."
          factory_data.factory_backup(backup_and_delete_old_data)
        end
      end
  </code></pre>
  
  <p>But when I run the rake task I get error:</p>
  
  <pre><code>TypeError: no implicit conversion of Pathname into String
  </code></pre>
  
  <p>for this line:</p>
  
  <pre><code>require Rails.root + '/config/boot'
  </code></pre>
  
  <p>Do you know how I can fix this issue?</p>