开发者

Syntax error in compiling .CSS file w/SASS 3.1.7 and previous versions

开发者 https://www.devze.com 2023-04-08 00:29 出处:网络
sass .CSS compilation fails on one machine, but works on the other. Using Sass gem version 3.1.7 on both w/Bundler.

sass .CSS compilation fails on one machine, but works on the other. Using Sass gem version 3.1.7 on both w/Bundler.

If I do bundle show sass on both machines, they have identical output. Can't seem to track down what is at the root of this. I tried dumping my Gemfile.lock, and running bundle install from scratch - no go - same error message. Tried locking to some previous versions of the gem (3.1.6 and 3.1.5 specifically) - no change in symptoms.

Not 100% sure what version of the gem I was using previously, but I've only been using Sass since mid-August, and it was never locked down to a version before, so I figured I'd try locking to the two previous versions, both of which 开发者_开发问答were released before I began using Sass.

$ bundle show sass
/Users/[username]/.rvm/gems/ree-1.8.7-2011.03/gems/sass-3.1.7

And the error in the compiled .CSS file is:

Syntax error: Invalid property: ":background-image= image_url("public-fade-bg.png")".
        on line 5 of [/path/to/application]/app/stylesheets/public_admin.sass

1: // Styles for public views - authentication controller
2: @import application.sass
3: 
4: body
5:   :background-image= image_url("public-fade-bg.png")
6: #environment
7:   :position absolute
8:   :background-color= !development_color
9:   :font-size 18px
10:   :padding 0 5px


Solved this problem after discussing it with a fellow developer.

The long and short of it is that the syntax this particular app is using was supported in a previous version of Sass, but is no longer. One of the gems I was using, somewhere along the lines, got its version changed.

After fighting with it for a couple of days, I basically just rolled back my gems by checking out a known, working copy of the Gemfile and Gemfile.lock files from the application repository, and then did a bundle install --deployment

After that, everything came back online, and worked as it did before this process started.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号