简体   繁体   中英

Rollback rake assets:precompile

I operate Rails 3.2.13 and I ran a

rake assets:precompile

In order to activate some CoffeeScript that wouldn't fire otherwise, and it completely ruined my pages layout, which was fine until then. The menu of my application is now vertical instead of horizontal and the rest of the pages is subsequently invisible.

I use Bootstrap and I suspect this has been updated, for some reason, but it's too much work to change it, if I only knew why it has changed and what has changed anyway...

I would like to go back to the former state of my layout.

Is there any way to roll back ?

remove public/assets

explanation: the precompile task compiles your assets, usually in app/assets, and places them in your public folder/assets folder.

If you want to go back to the state prior to the precompile, just remove public/assets

rm -fr public/assets.

ok, this should be the problem: you changed your bootstrap version from 2.1 to 3.1 and the syntax you're using is not suitable for 3.1. That's not a question of compiling assets, just that from version 2 to version 3, there's a totally new syntax.

Have a look here:

http://getbootstrap.com/migration/

Then set your bootstrap gem version to 2.1 in your gemfile and run bundle install. Everything should go back to the right place.

I had this problem too. In addition to removing the precompiled assets under the public folder, I also had to clear the tmp/cache folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM