Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Assets precompilation fails with 2.1.2 #341

kugaevsky opened this Issue Aug 21, 2012 · 22 comments


None yet

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

Any suggestions?

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

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.

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


michaelirey commented Aug 21, 2012

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

Me too, same error

ivanyv commented Aug 22, 2012

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 commented Aug 22, 2012

@ivanyv is line 25 fix that problem?


seyhunak commented Aug 22, 2012


michaelirey commented Aug 22, 2012

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

@seyhunak not only line 25, but also line 39
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 commented Aug 22, 2012

@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.

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.

Any news on this issue? I facing the same!

iamvery commented Aug 30, 2012

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

It seems to all works fine with 2.1.3

thanks guys!

I think I should close this issue.

@kugaevsky kugaevsky closed this Aug 30, 2012

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:

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

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 commented Jan 4, 2013

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 commented Jan 4, 2013

@tdak what is your trace output?

tdak commented Jan 4, 2013

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