【问题标题】:Rake assets:precompile耙资产:预编译
【发布时间】:2013-04-02 02:57:42
【问题描述】:
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)

【问题讨论】:

  • 你用bundle exec跑了吗?这样做应该确保您调用的是正确版本的rake,(即尝试bundle exec rake assets:precompile
  • 尝试删除文件 Gemfile.lock 并运行 bundle install 命令。

标签: mysql ruby-on-rails windows postgresql phpmyadmin


【解决方案1】:

你应该先删除你的Gemfile.lock文件和bundle install,然后再使用

rake assets:precompile

这是因为您已激活 rake 10.0.4,但在 Gemfile.lock 文件中它是 rake 10.0.3,因此您要么更改它,要么删除 Gemfile.lock 文件。

【讨论】:

  • 除此之外,如果您不想删除您的Gemfile.lock 文件,您应该能够只运行bundle update rake 来更新您的应用程序使用的rake 版本。
【解决方案2】:

通过

将您的 rake 更新到 10.0.4
bundle update rake

这会解决它

【讨论】:

    【解决方案3】:

    请尝试

    捆绑 exec rake 资产:预编译

    你应该先谷歌一下

    【讨论】:

    • 这确实有效,但我更愿意遵循 Nicks 的方法并在你的包中更新 rake。
    【解决方案4】:

    你可以使用 bundle exec rake assets:precompile 如果您更新数据库迁移,您可以使用: bundle exec rake db:迁移

    【讨论】:

      猜你喜欢
      • 2013-07-06
      • 2013-09-28
      • 2013-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-30
      • 1970-01-01
      • 2015-08-28
      相关资源
      最近更新 更多