【问题标题】:Rake Aborted, Gemfiles requires a different rakeRake Aborted,Gemfiles 需要不同的 rake
【发布时间】:2014-01-12 02:35:56
【问题描述】:

我正在使用 MySQL Server 5.7(64 位)、MySQL 连接器 C 6.1 6.1.2(32 位)、Ruby 1.9.3p392(2013)在 Windows 7(64 位)上通过 Lynda.com 完成教程 Ruby on Rails 3 Essential Training -02-22) [i386-mingw32] 和 Rails 3.2.12。

在培训中,我在“数据库和迁移”部分尝试将我在 MySQL 中创建的数据库与我的 Rails 项目同步,但是我遇到了中止消息。

讲师要求我的班级通过命令提示符打开我们的 rails 项目并执行 Rake 以使用以下代码构建“schema.rb”:

这就是我现在运行“db:schema:dump”时的意思

C:\Sites\todo>rake db:schema:dump rake aborted!

You have already activated rake 10.1.1, but your Gemfile requires rake 10.0.3.

Using bundle exec may solve this.

C:/Sites/todo/config/boot.rb:6:in'`

C:/Sites/todo/config/application.rb:1:in'`

C:/Sites/todo/Rakefile:4:in'`

(See full trace by running task with --trace)

如何获得 Gemfile 所需的 rake?

【问题讨论】:

  • 之前尝试bundle install

标签: mysql ruby-on-rails ruby ruby-on-rails-3 mysql-5.7


【解决方案1】:

如此活跃的 gem 版本 10.1.1,但你的项目有依赖 10.0.3

要解决,只需在rake db:schema:dump 之前使用bundle exec

bundle exec rake db:schema:dump

由于您在 Gemfile 有旧版本,您可以执行 gem uninstall rakebundle install,这将安装正确版本的 rake

【讨论】:

    【解决方案2】:

    为了解决这个问题,我决定从我的计算机上删除 Windows,并下载一个名为 Ubuntu 的 Linux 发行版。通过改变我所处的编程环境,这完全绕过了这个问题,从而在适合在 Ruby 中执行的编程环境中加速了我。我不必在新电脑上花任何钱,但我确实浪费了大约 3 个月的时间等待得到这个问题的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-15
      • 1970-01-01
      相关资源
      最近更新 更多