10

我执行

$ 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

但它看起来不起作用,因为我可以通过 http 请求访问资产,而且如果我打开heroku 控制台,我可以看到文件:

$ 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"]

我需要删除资产,因为它们与我的新配置产生冲突。

4

2 回答 2

23

rake assets:clean 功能已被替换为

rake assets:clobber

在最新版本的 Rails 中。

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

于 2013-03-12T07:16:25.673 回答
4

我必须做:

heroku repo:purge_cache

等一下。rake assets:clobber对我不起作用,即使它打印了:

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

如果你运行 heroku 命令并得到:

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

在你的heroku工具带中安装命令:

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

并重新运行。

于 2016-01-21T23:22:48.733 回答