Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Assets precompilation fails with 2.1.2 #341

Closed
kugaevsky opened this Issue · 22 comments
@kugaevsky

I got error trying to compile assets with latest version.
Everything is ok when downgrading to 2.1.1

Here is gist with full trace
https://gist.github.com/3416638

Any suggestions?

@jpeters98

Can we perhaps see the pertinent line of CSS where you're setting the background-position?

@kugaevsky

I've searched through all twitter-bootstrap less files, but didn't find wrong line.
Unfortunatly, I cann't say exact line of code where compilation fails.

@hadronzoo

I'm getting the same error, Invalid CSS after "...172b8e2a.png"")": expected "{", was ";background-pos...", on asset pre-compilation (without any LESS customization).

@michaelirey

I too am having this same issue when using 2.1.2. No issue with 2.1.1

@stefanoferretti

Me too, same error

@ivanyv

On vendor/toolkit/twitter/bootstrap/sprites.less @ line 25:

background-image: url("@{iconSpritePath}");

Before, this was:

background-image: url(@iconSpritePath);

At first I thought I had an outdated less gem, but it's 2.2.1. I can't try the latest git commit for that gem because it causes another problem. so I'm at a loss.

@seyhunak
Owner

@ivanyv is line 25 fix that problem?

@michaelirey

gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git', :ref => 'aea3f7e5935290cb63806d98bb72c64c71ffca91' Still has the same problem

@kugaevsky

@seyhunak not only line 25, but also line 39
https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/vendor/toolkit/twitter/bootstrap/sprites.less#L39
It has the same variable interpolation that causes error. Everything compiles well if change it to

background-image: url(@iconWhiteSpritePath);

But I'm not really sure that it is right way to fix this issue. Original twitter-bootstrap code compiles with this interpolation as well.

@ivanyv

@seyhunak as @kugaevsky points out, it's two lines. I didn't mention the other because also as @kugaevsky says, I don't think it's a good idea to "fix" bootstrap, but rather find out why it's not compiling. I'm thinking it's something to do with the less gem version.

@kugaevsky

Finally, I've found exact compilation step that breaks the process. It happens on compressing assets. So if you turn off this feature in production environment compilation completes as usual. But remember that your static files will have greater size without compression.

To do it just set option config.assets.compress = false in your config/environments/production.rb

I'll try to investigate further. Seems to be it's uglifier gem breaks compilation.

@b-murphy

Any news on this issue? I facing the same!

@iamvery

@brendanamsterdammurphy I believe the 2.1.3 release fixes this. I have successfully precompiled and deployed using 2.1.3 release

@kugaevsky

It seems to all works fine with 2.1.3

@b-murphy

thanks guys!

@kugaevsky

I think I should close this issue.

@kugaevsky kugaevsky closed this
@DavyCardinaal

I've got the same issue when upgrading to 2.1.5.

Issue was solved in 2.1.3 and 2.1.4 but the following code is back in 2.1.5:
vendor/toolkit/twitter/bootstrap/sprites.less

background-image: url("@{iconSpritePath}");
@counterbeing

I've just run into this issue with 2.1.5 as well. Downgraded to 2.1.4, same issue. Then to 2.1.3, which compiled my assets just fine. I guess I'll stick with that for now.

@tdak

Been getting the same problems all morning. On one server with 2.1.0 works no problem on another it doesn't work for any version (tried 2.1.3, 2.1.5, 2.1.6, 2.1.9, 2.2.0). If I remove .png extensions it works. But why should it fail if .png is present.

This is where it fails I think.

@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');

@seyhunak
Owner

@tdak what is your trace output?

@tdak

I figured it out. I escaped the double quotes in my deploy.rb file for RAILS_RELATIVE_ROOT variable and it messes up the compiling of the sheets.

I had RAILS_RELATIVE_ROOT=\"/etd\" in the deploy task, which triggers the error. It works without the quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.