3
votes

I have a Rails 3.2 app with twitter-boostrap-rails gem. Running rake assets:precompile fails with this:

alex@BlackBeast:~/myapp$ rake assets:precompile
/home/alex/.rvm/rubies/ruby-1.9.3-head/bin/ruby /home/alex/.rvm/gems/ruby-1.9.3-head@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Invalid CSS after "...4882640c.png"")": expected "{", was ";background-pos..."
  (in /home/alex/myapp/app/assets/stylesheets/application.css)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/alex/.rvm/rubies/ruby-1.9.3-head/bin...]

Is there any way I could debug this problem? Have no idea what to do about this.

Update: after updating twitter-bootstrap-rails gem to 2.1.6 version, the precompile now fails with a different error:

rake aborted!
Invalid CSS after "}​": expected "{", was ""
  (in /home/alex/myapp/app/assets/stylesheets/application.css)
(sass):1673

The application.css mentioned in the error is a standard one, with

*= require_self
 *= require_tree .

..which makes a bit hard to determine which part causes problems.

Can I compile somehow only bootstrap_and_overrides.less and see where the things go wrong?

1
I've sort of resolved this by using twitter-bootstrap-rails gem version 2.1.3 - after that assets are compiling for production fine. - Alexander Savin
Thanks, that solved it for me too. - ericteubert
you can post an answer to your own question and accept it - mihai
Well this is not an answer, it is temporary workaround :D - Alexander Savin
This workaround worked for me. I wonder if this could be happening because of trailing newlines. Here is a blog post about trailing newlines and the Asset Pipeline : transmitit.com/2012/10/asset-pipeline-gotcha-trailing-newlines - Bigginn

1 Answers

1
votes

It appears to be fixed in the latest release (2.1.6). Putting this in your gemfile should do the trick.

gem 'twitter-bootstrap-rails' , '>= 2.1.6'