Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"heroku run rake assets:clean" doesn't clean anything

I execute

$ heroku run rake assets:clean
Running `rake assets:clean` attached to terminal... up, run.2
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:clean:all RAILS_ENV=production RAILS_GROUPS=assets
rm -rf /app/public/assets

But it doesn't look like it is working due I can access to the assets by http request and also if I open a heroku console I can see the files:

$ heroku run console
irb(main):013:0> Dir.glob "./public/assets/*"
=> ["./public/assets/img", "./public/assets/application.js.gz", "./public/assets/application.js", "./public/assets/rails.png", "./public/assets/manifest.yml", "./public/assets/application.css", "./public/assets/assets", "./public/assets/application.css.gz"]

I need to remove the assets because they are producing conflicts with my new configuration.

like image 767
fguillen Avatar asked Sep 02 '12 12:09

fguillen


2 Answers

The rake assets:clean functionality has been replaced with

rake assets:clobber

in the latest version of Rails.

https://github.com/rails/sprockets-rails/blob/master/README.md

like image 193
Chris Aitchison Avatar answered Oct 05 '22 23:10

Chris Aitchison


I had to do:

heroku repo:purge_cache

and wait a bit. rake assets:clobber did not work for me, even though it printed:

INFO -- : Removed /app/public/assets
rm -rf /app/tmp/cache/assets]

if you run the heroku command and get:

 !    `repo:purge_cache` is not a heroku command.
 !    See `heroku help` for a list of available commands.

install the command in your heroku toolbelt with:

heroku plugins:install https://github.com/heroku/heroku-repo.git

and rerun.

like image 26
traday Avatar answered Oct 05 '22 23:10

traday