2017-07-28 98 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運行任務查看完整跟蹤) –