2017-07-28 46 views
0

我想连接到mysql并使用命令rake db:create 。它告诉我错误rake db:在rake db上创建显示错误:create

rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) /Library/Ruby/Gems/2.0.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>' (See full trace by running task with --trace) 

我也尝试过rake db:migrate,但同样的错误。

回答

1

它看起来像你缺少一个耙文件。将此代码添加到应用程序根目录的Rakefile文件中。 编辑:您的应用程序的名称替换YourApp

require File.expand_path('../config/application', __FILE__) 

YourApp::Application.load_tasks 
+0

require_relative '配置/应用' Myrail :: Application.load_tasks –

+0

不知道如何建设任务 'DB:创建'(见--tasks ) /Library/Ruby/Gems/2.0.0/gems/rake-11.3.0/exe/rake:27:in'' (通过使用--trace运行任务查看完整跟踪) –

相关问题