Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rake assets:precompile

C:\Sites\dtr-payroll>rake assets:precompile
rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 10.0.3. Using bundle exec may solve this.
C:/Sites/dtr-payroll/config/boot.rb:6:in `<top (required)>'
C:/Sites/dtr-payroll/config/application.rb:1:in `<top (required)>'
C:/Sites/dtr-payroll/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
like image 577
Kirvk548 Avatar asked Apr 02 '13 02:04

Kirvk548


People also ask

What does rake assets Precompile do?

By default, Rails uses CoffeeScript for JavaScript and SCSS for CSS. DHH has a great introduction during his keynote for RailsConf. The Rails asset pipeline provides an assets:precompile rake task to allow assets to be compiled and cached up front rather than compiled every time the app boots.

What does rake assets clobber do?

Two cleanup tasks: rake assets:clean is now a safe cleanup that only removes older assets that are no longer used, while rake assets:clobber nukes the entire public/assets directory. The clean task allows for rolling deploys that may still be linking to an old asset while the new assets are being built.


3 Answers

you should first delete your Gemfile.lock file and bundle install again and then use

rake assets:precompile

this is because you have activated rake 10.0.4 but in your Gemfile.lock file it is rake 10.0.3 so either you changed it or delete Gemfile.lock file.

like image 104
shrikant1712 Avatar answered Oct 17 '22 08:10

shrikant1712


Update your rake to 10.0.4 via

bundle update rake

that would fix it

like image 40
Nick Ginanto Avatar answered Oct 17 '22 08:10

Nick Ginanto


please try

bundle exec rake assets:precompile

you should google it first

like image 39
neocanable Avatar answered Oct 17 '22 08:10

neocanable