title: Why do I get MIME type ('text/html') is not executable error for ckeditor rails gem on image uploads?
body: <p>When I go to edit a resource I get the above error for config.js and then when I go to view the resource I get it too. Also all my image uploads are broken urls when I go to view them in the actual post and when I go to the backend and edit the resource I click 'browser server' on image upload button and all images that were previously uploaded show as broken image links.</p>
  
  <p>Here is my setup:</p>
  
  <p>Rails 4
  Paperclip image handling
  ckeditor ckeditor (4.0.10)</p>
  
  <p><strong>/models/ckeditor/picture.rb</strong></p>
  
  <pre><code>class Ckeditor::Picture &lt; Ckeditor::Asset
    has_attached_file :data,
                      :url  =&gt; "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
                      :path =&gt; ":rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension",
                      :styles =&gt; { :content =&gt; '800&gt;', :thumb =&gt; '118x100#' }
  
    validates_attachment_size :data, :less_than =&gt; 2.megabytes
    validates_attachment_presence :data
    do_not_validate_attachment_file_type :data
  
    def url_content
      url(:content)
    end
  end
  </code></pre>
  
  <p><strong>/config/initializers/ckeditor.rb</strong></p>
  
  <pre><code>Ckeditor.setup do |config|
    # ==&gt; ORM configuration
    # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
    # :mongoid (bson_ext recommended) by default. Other ORMs may be
    # available as additional gems.
    require "ckeditor/orm/active_record"
  
    # Allowed image file types for upload.
    # Set to nil or [] (empty array) for all file types
    # config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]
  
    # Allowed attachment file types for upload.
    # Set to nil or [] (empty array) for all file types
    # config.attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "swf"]
  
    # Setup authorization to be run as a before filter
    # config.authorize_with :cancan
  
    # Asset model classes
    # config.picture_model { Ckeditor::Picture }
    # config.attachment_file_model { Ckeditor::AttachmentFile }
  
    # Paginate assets
    # config.default_per_page = 24
  end
  </code></pre>
  
  <p><strong>/config/application.rb</strong></p>
  
  <pre><code>module PopupHub
    class Application &lt; Rails::Application
  
      config.exceptions_app = self.routes
  
      # Settings in config/environments/* take precedence over those specified here.
      # Application configuration should go into files in config/initializers
      # -- all .rb files in that directory are automatically loaded.
  
      # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
      # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
      # config.time_zone = 'Central Time (US &amp; Canada)'
  
      # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
      # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
      # config.i18n.default_locale = :de
  
      config.nav_lynx.selected_class = 'current'
  
      config.assets.paths &lt;&lt; Rails.root.join('app', 'assets', 'fonts')
  
      config.assets.paths &lt;&lt; Rails.root.join('app', 'assets', 'font-awesome')
  
      config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
  
      config.assets.initialize_on_precompile = false
      config.assets.precompile += %w( style.css *.scss *.js *.woff *.ttf )
  
    end
  end
  </code></pre>
  
  <p><strong>error when editing a resource in console</strong></p>
  
  <pre><code>Refused to execute script from '/assets/ckeditor/config-65b33bedd052d521bd0b685fa5bb9800.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
  </code></pre>
  
  <p>When viewing textarea</p>
  
  <p><img src="https://i.stack.imgur.com/bY8JO.png" alt="This is what I see"></p>
  
  <p>Then when I try to access the Browse Images area I get this:</p>
  
  <p><img src="https://i.stack.imgur.com/MWuj1.png" alt="enter image description here"></p>
  
  <p>When I go and check on the server, the folders these images are meant to be uploaded to are missing or not there at all and I do not know why that would happen at all.</p>
  
  <p>Has anyone ever experienced this?</p>