I am trying to deploy my app on Heroku but I don't know why the bellow error occurs.
I have gem 'rails_12factor', group: :production
so I don't use config.serve_static_assets = true
and config.assets.initialize_on_precompile
as in the documentation explained that they are not needed in Rails 4.
When I execute these two commands respectively:
bundle exec rake assets:precompile
RAILS_ENV=production bundle exec rake assets:precompile
I get this error.
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in tsort_each at /usr/local/lib/ruby/2.2.0/tsort.rb:226)
I, [2016-06-14T13:21:21.336814 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/font-awesome.min-1c15db9e10c99a36820b80616445a837a002b3f3969047f3375fba65f8fef2ba.css
I, [2016-06-14T13:21:21.337563 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/font-awesome.min-1c15db9e10c99a36820b80616445a837a002b3f3969047f3375fba65f8fef2ba.css.gz
I, [2016-06-14T13:21:21.341449 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/bootstrap.min-139ad6ac9cbd7b8cd15fa3f80b9b69e3ead570cb9686b3bb42b73a19ed62dcef.css
I, [2016-06-14T13:21:21.343432 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/bootstrap.min-139ad6ac9cbd7b8cd15fa3f80b9b69e3ead570cb9686b3bb42b73a19ed62dcef.css.gz
I, [2016-06-14T13:21:21.400914 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/jquery.fancybox-9eb4dcf39f4ad63c3bff3f55e2a0e5e8a32578cc4553c94633ce0ccdc08c2bea.css
I, [2016-06-14T13:21:21.401335 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/jquery.fancybox-9eb4dcf39f4ad63c3bff3f55e2a0e5e8a32578cc4553c94633ce0ccdc08c2bea.css.gz
I, [2016-06-14T13:21:21.405283 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/animate-0af100ee0144b8c4dc6de8605097b0920d4ea4aad067cc34fbaa7ab525d4e6a8.css
I, [2016-06-14T13:21:21.405707 #10455] INFO -- : Writing /home/rails/Desktop/hammasir/public/assets/animate-0af100ee0144b8c4dc6de8605097b0920d4ea4aad067cc34fbaa7ab525d4e6a8.css.gz
rake aborted!
Sass::SyntaxError: Invalid CSS after "}": expected selector or at-rule, was "}"
(sass):86
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I debugged and checked one of the files but I couldn't find any error like forgetting to use ), } or ; . Also, I cleaned the whole content of one of them and replace it by a simple CSS rule, but still I get the error!!
This error is also happening when I try to push
my app to Heroku. Please, help me to understand what is the reason and its solution??
This is the answer I found, wishing it to be useful for others, too.
To solve the DEPRECATION WARNING, update your gems as expressed by:
Asset pipeline DEPRECATION WARNING tsort.rb:226
And about the main error, you should find which file causes the error exactly. The error output and mentioned files in it are misleading and not necessarily contain syntax error.
You can work with your assets.rb
file to find which file (files) contains syntax error. Comment or remove all of the referred files in assets.rb
except one, redo asset precompile command in your production mode:
RAILS_ENV=production bundle exec rake assets:precompile
and repeat it for all other css files to understand which one contains the error. This time the output of this command will be helpful and refer exactly to the problem. Then, it would be easy to find the error and fix it.