質問

When I attempt to push my app to Heroku, it fails and I get this error:

       Running: rake assets:precompile
   rake aborted!
   Sass::SyntaxError: Invalid CSS after "...AwesomeEotPath:": expected pseudoclass or pseudoelement, was "  'fontawesome-..."
   (in /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/app/assets/stylesheets/application.css)
   (sass):7150
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1147:in `expected'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1085:in `expected'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:1067:in `expr!'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:794:in `pseudo'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:672:in `simple_selector_sequence'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:640:in `_selector'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:619:in `selector'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:155:in `directive'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:553:in `block_child'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:546:in `block_contents'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:82:in `stylesheet'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/scss/parser.rb:27:in `parse'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:342:in `_to_tree'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:315:in `_render'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sass-3.2.19/lib/sass/engine.rb:262:in `render'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/sass_compressor.rb:24:in `evaluate'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:25:in `initialize'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger'
   /tmp/build_dff3b836-b2e8-484b-a8ea-cdcf1febef51/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
   Tasks: TOP => assets:precompile
   (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.

The app will load, but none of my assets are loaded. My application.css

/*
 * 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's generally better to create a new file per style scope.
 *
 *= require_self
 *= require_tree .
 */

.table td.center, .table th.center {
   text-align: center;
}

I'm not too sure what is going on here or how to fix this. Any help would be appreciated.

役に立ちましたか?

解決

The error is here:

Sass::SyntaxError: Invalid CSS after "...AwesomeEotPath:": expected pseudoclass or pseudoelement, was " 'fontawesome-..."

You problem is you're trying to load a method which the SASS preprocessor doesn't understand. It looks like the method in question is AwesomeEotPath, but I can't be sure without seeing the offending code.

When you precompile your assets, it basically takes everything in your asset manifest (the require parts at the top of your file), and compiles them into the application.css (or whatever your file is called)

You mention your file is structured as so:

/*
 *= require_self
 *= require_tree .
*/

I'd recommend your errors will be caused by one of the require_tree . includes that you've got in your file. You should post any other CSS files & CSS dependencies you have in your app. For example, if you've called the font-awesome-rails gem, you'll might have to disable this

If you post your other CSS & Gemfile, we'll be in a better position to help you

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top