简体   繁体   中英

Rails Assets:Precompile Failure, Invalid CSS

When running

rake assets:precompile

I get the following error:

"Invalid CSS after "...it-box-shadow: ": expected expression (eg 1px, bold), was ":inset 0 -1px 0..."

The offending css is in bootstrap.css:

.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.428571429;
  color: #555555;
  vertical-align: middle;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

This setting is all throughout the bootstrap.css file and was taken from a WrapBootstrap theme. The syntax appears correct, so I can't understand why the precompile is failing.

application.css.scss:

*
*= require jquery.ui.all
*= require bootstrap
*= require animations
*= require font-awesome
*= require font-awesome-ie7
*= require graph
*= require ie
*= require nivo-slider
*= require prettyPhoto
*= require pricing-table
*= require settings
*= require style
*= require spectrum
*= require superfish
*= require switcher
*= require team-member
*= require theme-responsive
*= require colors/red
*= require video-js
*= require_self
*/

.contact{
  padding-top: 50px;
}

Am I missing something or is this not valid syntax?

When adding your bootstrap gem you should specify the version. The version you have installed is likely not the same as the bootstrap CSS being used. Bootstrap changes all the time.

As a side note, run rake assets:clean && rake assets:precompile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM