简体   繁体   English

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

[英]Rake Aborted, Gemfiles requires a different rake

I am completing the tutorial Ruby on Rails 3 Essential Training through Lynda.com on Windows 7 (64 bits) using MySQL Server 5.7(64bits), MySQL Connector C 6.1 6.1.2 (32bits), Ruby 1.9.3p392 (2013-02-22) [i386-mingw32] and Rails 3.2.12. 我正在使用MySQL Server 5.7(64位),MySQL Connector C 6.1 6.1.2(32位),Ruby 1.9.3p392(2013-02-)在Windows 7(64位)上通过Lynda.com完成Ruby on Rails 3 Essential Training教程。 22)[i386-mingw32]和Rails 3.2.12。

In the training, I am in the section on "Databases and Migrations" attempting to sync the database I have created in MySQL with my Rails project, however I have been running into an abort message. 在培训中,我在“数据库和迁移”部分尝试将我在MySQL中创建的数据库与我的Rails项目同步,但是我一直在遇到中止消息。

The instructor asked my class to go through Command Prompt to open up our rails project and perform a Rake to build a "schema.rb" with this code: 教师要求我的班级通过命令提示符打开我们的rails项目并执行Rake以使用以下代码构建“schema.rb”:

This is what it says now when I run "db:schema:dump" 这就是我现在运行“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/boot.rb:6:in '`中

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

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

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

What do I do to get the rake that the Gemfile needs? 我该怎么做才能获得Gemfile需要的rake?

So active gem version 10.1.1, but your project have dependency 10.0.3 所以活跃的gem版本10.1.1,但你的项目有依赖10.0.3

To solve just use bundle exec before rake db:schema:dump 要解决只是在rake db:schema:dump之前使用bundle exec

bundle exec rake db:schema:dump

As you have older version at Gemfile, you can do gem uninstall rake , bundle install , this will install proper version of rake . 由于您在Gemfile上有旧版本,您可以执行gem uninstall rakebundle install ,这将安装正确版本的rake

To solve this issue, I decided to delete Windows off of my computer and download a Linux distribution called Ubuntu. 为了解决这个问题,我决定从我的计算机上删除Windows并下载一个名为Ubuntu的Linux发行版。 This completely bypassed the issue by changing the programming environment I was in and thereby accelerated me in a programming environment suitable to perform in Ruby. 这通过改变我所处的编程环境完全绕过了这个问题,从而加速了我在适合在Ruby中执行的编程环境。 I didn't have to spend any money on a new computer, but I did lose about 3 months time waiting to get an answer to this question. 我没有在新电脑上花钱,但我确实失去了大约3个月的时间来等待这个问题的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM