I’m getting an error when running rake assets:precompile on my production server. As far as I can tell, I didn’t do anything differently before this happened. Running rake assets:precompile on my development machine doesn’t yield any errors. I’m not sure how to debug this. Suggestions? I tried running with the --trace option, but it didn’t really give me any more useful information to point me toward a bug in the code.
deploy@example.com:~/www/example.com/app/assets/stylesheets$ rake assets:precompile
(in /home/deploy/www/example.com)
/home/deploy/.rvm/rubies/ruby-1.9.3-p194/bin/ruby /home/deploy/.rvm/gems/ruby-1.9.3-p194@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/deploy/www/example.com/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/deploy/.rvm/rubies/ruby-1.9.3-p194/b...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I ended up resolving this. As it turns out, this was a problem with the Twitter bootstrap rails gem I was using. I was using https://github.com/seyhunak/twitter-bootstrap-rails. It turns out this was an error in one of the sheets being imported in the bootstrap_and_overrides.less file. The solution for me was freezing the gem in my Gemfile to version 2.1.7 and dealing with any dependency issues that cropped up afterwards.