Rails 3.1 compress assets production fails when compress is set to true


I can deploy to staging fine.

When i try and deploy to production i get the following error below,
it gets so far and then bombs out.

RAILS_ENV=production bundle exec rake assets:precompile --trace

mkdir -p /var/www/rails/workstars/site/releases/20120117151339/public/
mkdir -p /var/www/rails/workstars/site/releases/20120117151339/public/
rake aborted!
undefined method `bytesize' for nil:NilClass

I have narrowed it down to this piece of code which is enabled in

config.assets.compress = true

Anyone got any ideas, im a bit lost at this stage,


I had a similar issue just today, which was solved by adding to config/
environments/production.rb the following:

  config.assets.precompile += %w(... rails_admin/rails_admin.js

Hope it helps if you still face this problem.

Also keep in mind that you'll need to make sure the debug option is
off otherwise it will force it to render individual assets.