耙子中止,Gemfiles需要不同的耙子

时间:2013-12-23 20:46:43

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

我正在使用MySQL Server 5.7(64位),MySQL Connector C 6.1 6.1.2(32位),Ruby 1.9.3p392(2013)通过Lynda.com在Windows 7(64位)上完成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?

2 个答案:

答案 0 :(得分:5)

如此活跃的gem版本10.1.1,但您的项目具有依赖关系10.0.3

要解决在bundle exec

之前使用rake db:schema:dump的问题

bundle exec rake db:schema:dump

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

答案 1 :(得分:1)

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