2013-04-02 175 views
7
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) 
+0

你用'bundle exec'運行嗎?這樣做應該確保你正在調用'rake'的正確版本(例如,嘗試'bundle exec rake assets:precompile') –

+0

嘗試刪除文件Gemfile.lock並運行bundle install命令。 – prabu

回答

19

你首先應該再刪除您Gemfile.lock文件和bundle install和然後用

rake assets:precompile 

這是因爲你已經激活了rake 10.0.4,但是在你的Gemfile.lock文件中是rake 10.0.3,所以要麼你改變它,要麼刪除Gemfile.lock文件。

+4

此外,如果您不想刪除'Gemfile.lock'文件,您應該可以運行'bundle update rake'來更新應用程序使用的耙式版本。 – fatty

2

請儘量

束EXEC耙資產:預編譯

你應該google一下第一

+0

這是行得通的,但我更願意跟隨尼克斯的方法並更新你的捆綁包中的耙子。 – Besi

5

更新通過

bundle update rake 

你耙10.0.4將修復它

0

您可以使用捆綁的exec耙資產:預編譯 如果更新數據庫遷移,你可以使用: 束exec rake db:migrate

相關問題