0

My scss doesn't seem to be compiling correctly. Written below is the configuration instructions I found on several blogs, and the compass website itself, but I can't seem to get the scss to configure.

Here is the error I'm getting in my browser console: Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream: "localhost:4567/stylesheets/dashboard.scss"

server.rb

require "compass"
require "sinatra"
require "haml"

configure do
  set :haml, {:format => :html5, :escape_html => true}
  set :scss, {:style => :compact, :debug_info => false}
  Compass.add_project_configuration(File.join(Sinatra::Application.root, 'config', 'compass.rb'))
end

get '/stylesheets/:name.css' do
  content_type 'text/css', :charset => 'utf-8'
  scss :"stylesheets/#{params[:name]}", Compass.sass_engine_options
end

get '/' do
    @workflow_audits = Auditor.new("jspillers").workflow_audits
    haml :dashboard
end

config/compass.rb

if defined?(Sinatra)
  # This is the configuration to use when running within sinatra
  project_path = Sinatra::Application.root
  environment = :development
else
  # this is the configuration to use when running within the compass command line tool.
  css_dir = File.join 'public', 'stylesheets'
  relative_assets = true
  environment = :production
end

# This is common configuration
sass_dir = File.join 'public', 'stylesheets'
images_dir = File.join 'public', 'images'
http_path = "/"
http_images_path = "/images"
http_stylesheets_path = "/stylesheets"

views/dashboard.erb (header)

%head
  %title Workflow Stuff 
  %link{ :rel => :stylesheet, :type => "text/scss", :href => "stylesheets/dashboard.scss"}
  %link{ :rel => :stylesheet, :href => "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css"}
  %script{ :src => "https://code.jquery.com/jquery-2.1.1.js" }
  %script{ :src => "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js" }

My stylesheet is public/stylesheets/dashboard.scss. My Gemfile has compass and haml.

emily6689
  • 1
  • 1
  • Is there an error? What is the error? – cimmanon Nov 13 '14 at 19:06
  • My SCSS file seems to be going through as CSS, and if I try and add special compass features such as nested attributes or $variables, they aren't being deciphered. – emily6689 Nov 13 '14 at 19:15
  • 1
    So all of the things in your question have nothing to do with the problem? – cimmanon Nov 13 '14 at 19:17
  • Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream: "http://localhost:4567/stylesheets/dashboard.scss". – emily6689 Nov 13 '14 at 19:24

0 Answers0