Application.css.scss does not match Rails 4

I was wondering why the style is not loaded,

So, I wrote incorrect content incorrectly on application.css.scss ,

And the precompile and load page did not give me any error.

I thought the application.css.scss file should not be downloaded and compiled.

Unfortunately, this does not seem to be the case.

application.css.scss

 @i2dmport "compass"; /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it generally better to create a new file per style scope. * *= require_self *= require jquery.fileupload-ui *= require dropzone/dropzone *= require dropzone/basicdew *= require_tree . */ @import "layout"; 

application.rb

 config.autoload_paths += %W(#{Rails.root}/app/pdfs) config.autoload_paths += %W(#{config.root}/lib/) # 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 & Canada)' config.assets.paths << "#{Rails.root}/vendor/themes" 

Gemfile (I'm not sure if there is a conflict)

 source 'http://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.1.5' # Use postgresql as the database for Active Record gem 'pg', '~> 0.17.1' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 4.0.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 1.2' group :doc do # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', require: false end gem "bootstrap-sass", "~> 3.1.1" gem "compass-rails" gem "therubyracer" gem "execjs" gem "hirb-unicode" gem "devise", "~> 3.3.0" gem "devise_ldap_authenticatable", "~> 0.6.1" gem "net-ldap" gem "will_paginate", "~> 3.0" gem "rspec" gem "awesome_print", require: "ap" gem "tinymce-rails" gem "simple_form" gem "haml-rails" gem "taps" gem "analytics-ruby" gem "bcrypt-ruby" gem "bourbon" gem 'cancancan', '~> 1.8' gem "sunspot_rails" gem "sunspot_solr" gem "simple-navigation" gem "simple-navigation-bootstrap" #fast command gem "spring", group: :development #Handy tools for active record gem "squeel", "~> 1.2.1" # Last officially released gem # gem "squeel", :git => "git://github.com/activerecord-hackery/squeel.git" # Track git repo gem 'prawn' gem 'rb-readline', "~> 0.5.0.pre.1" gem 'chartkick' gem 'rails-erd', :group => :development gem 'quiet_assets', group: :development gem 'curb' gem 'rest_client' # only for assets not required in production mode gem 'jquery-rails' gem 'jquery-ui-rails' gem 'jquery.fileupload-rails', "~> 1.10.0" gem 'twitter-bootstrap-rails' group :development do gem "faker" gem "rspec-rails" gem "guard-rspec" gem "pry" gem "pry-remote" gem "pry-nav" gem 'pry-rescue' gem 'pry-stack_explorer' end gem "paperclip", "~> 4.1" gem 'dropzonejs-rails' 

location

 !!! %html %head = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true = stylesheet_link_tag params[:controller] = javascript_include_tag "application", "data-turbolinks-track" => true = javascript_include_tag params[:controller], "data-turbolinks-track" => true 
+7
ruby-on-rails ruby-on-rails-4 asset-pipeline sprockets
source share
4 answers

I had the same problem and was driving me crazy. I had a / assets / stylesheets / mycustom _stylesheet.css.scss application with styles that were loaded during development, but when I was deployed to create on heroku, none of my styles appeared. I solved this by placing the custom.css file in the directory of my provider / assets / style sheets with this content:

 /* *= require mycustom_stylesheet */ 

I also added this line to my initializers / assets.rb file, although I'm not sure if this is necessary.

 Rails.application.config.assets.precompile += %w( mycustom_stylesheet.css ) 
+1
source share

Maybe you have a file "application.css" inside the folder "/ vendor / themes /" or "/ lib"?

What happens if you delete this line "config.assets.paths <" ltd? Rails.root / vendor / themes from application.rb file?

0
source share

Try the command below

 RAILS_ENV=production rake assets:precompile 

or

 RAILS_ENV=development rake assets:precompile 
0
source share

Today I ran into a similar problem that changes to application.css.scss not updated when styling a page. Later, I found out that this is due to the fact that an error occurred in my .scss file, and ul - with the u1 error. After fixing the error, the stylization is finally updated when the page is refreshed, without the need to restart the rail server.

0
source share