title: Rails Active Storage Error when attempting to attach photo on seed file
body: <p>I am populating a rails app via he seeds file and wanted to attach a picture to each account but it is not working and I can't figure out why.</p>
  <p>I read the ActiveStorage documentation and tried applying the solutions that I found on two different answers here on Stackoverflow to no avail, I can</p>
  <p>I'm getting the following error:</p>
  <pre><code>&gt; Clearing Database...
  &gt; Creating users...
  rails aborted!
  ActiveStorage::IntegrityError: ActiveStorage::IntegrityError
  /mnt/c/Users/pedro/code/ruby-projects/tinder-clone/db/seeds.rb:20:in `block in &lt;main&gt;'
  /mnt/c/Users/pedro/code/ruby-projects/tinder-clone/db/seeds.rb:12:in `times'
  /mnt/c/Users/pedro/code/ruby-projects/tinder-clone/db/seeds.rb:12:in `&lt;main&gt;'
  /mnt/c/Users/pedro/code/ruby-projects/tinder-clone/bin/rails:9:in `&lt;top (required)&gt;'
  /mnt/c/Users/pedro/code/ruby-projects/tinder-clone/bin/spring:15:in `&lt;top (required)&gt;'
  ./bin/rails:3:in `load'
  ./bin/rails:3:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:seed
  </code></pre>
  <p>This is my seed file:</p>
  <pre><code>require 'faker'
  require &quot;open-uri&quot;
  
  
  puts &quot;&gt; Clearing Database...&quot;
  Account.destroy_all
  
  puts &quot;&gt; Creating users...&quot;
  
  FILE = File.open('app/assets/images/portrait.jpg')
  
  15.times do 
    account = Account.create(
      first_name: Faker::Name.first_name,
      last_name: Faker::Name.last_name,
      username: Faker::Games::Witcher.monster,
      email: Faker::Internet.email,
      password: &quot;123456&quot;,
    )
    account.images.attach(io: FILE, filename: 'person.jpg', content_type: 'image/jpg')
  
  end
  
  puts &quot;&gt; Done!&quot;
  </code></pre>
  <p>And here is my model:</p>
  <pre><code>class Account &lt; ApplicationRecord
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :validatable
  
    has_many_attached :images
  
  end
  </code></pre>
  <p>I appreciate your help, thanks!</p>