title: Trying to attach file with Active Storage error
body: <p>I am trying to attach files using Active Storage and keep getting error:</p>
  
  <p>Unable to autoload constant ActiveStorage::Blob::Analyzable, expected 
  /Users/sergeylukyanenko/.rvm/gems/ruby-2.6.0/gems/activestorage-5.2.2/app/models/active_storage/blob/analyzable.rb to define it</p>
  
  <pre><code>Request
  Parameters:
  
  {"utf8"=&gt;"✓",
   "authenticity_token"=&gt;"L0czdSokZuL6CyRqMNEUAj/6AGRItCOZ/oIca6OGHtgsxD+ExTnZ1BtMdvFyHQTOEZ5/5LEd6dma23r1r8zIlA==",
   "event"=&gt;
    {"name"=&gt;"Coffee meetup",
     "date"=&gt;"2019-01-28",
     "image"=&gt;
      #&lt;ActionDispatch::Http::UploadedFile:0x00007ff464e03278
       @content_type="image/jpeg",
       @headers="Content-Disposition: form-data; name=\"event[image]\"; filename=\"agile-software-development.jpg\"\r\n" + "Content-Type: image/jpeg\r\n",
       @original_filename="agile-software-development.jpg",
       @tempfile=#&lt;File:/var/folders/6j/xkzm5glx2k9_ycr6c235lx2m0000gn/T/RackMultipart20190128-91451-1jdmov.jpg&gt;&gt;},
   "commit"=&gt;"Create Event"}
  </code></pre>
  
  <p>Here is my EventsController</p>
  
  <pre><code>def create
      if current_user
        @event = current_user.events.build(event_params)
      else
        @event = Event.new(event_params)
      end
  
      respond_to do |format|
        if @event.save
          format.html { redirect_to @event, :flash =&gt; { :success =&gt; 'Event was successfully created.' }}
          format.json { render :show, status: :created, location: @event }
        else
          format.html { render :new }
          format.json { render json: @event.errors, status: :unprocessable_entity }
        end
      end
    end
  
    def event_params
      params.require(:event).permit(:name, :date, :private, :image)
    end
  </code></pre>
  
  <p>And Event Model</p>
  
  <pre><code>class Event &lt; ApplicationRecord
    validates :name, presence: true
    validates :date, presence: true
  
    has_one_attached :image
    belongs_to :user, optional: true
    has_many :tasks, dependent: :destroy
  
    scope :only_public,    -&gt; { where(private: false) }
    scope :only_private,   -&gt; { where(private: true)  }
    scope :by_recent,      -&gt; { order(date: :asc) }
  
    def start_time
      self.date
    end
  end
  </code></pre>
  
  <p>Event form</p>
  
  <pre><code>&lt;div class="field mt-4"&gt;
    &lt;%= form.file_field :image %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>config/storage.yml</p>
  
  <pre><code>test:
    service: Disk
    root: &lt;%= Rails.root.join("tmp/storage") %&gt;
  
  local:
    service: Disk
    root: &lt;%= Rails.root.join("storage") %&gt;
  
  # Use rails secrets:edit to set the AWS secrets (as shared:aws:access_key_id|secret_access_key)
  amazon:
    service: S3
    access_key_id: &lt;%= Rails.application.secrets.aws[:access_key_id] %&gt;
    secret_access_key: &lt;%= Rails.application.secrets.aws[:secret_access_key] %&gt;
    region: us-east-1
    bucket: your_own_bucket
  </code></pre>