2013-04-02 151 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

相关问题