简体   繁体   中英

rake db:create - rake aborted - no rakefile found

So, the title is quite self explanatory, but here's the following ..

rake db:create
rake aborted!
No rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

Any help would be appreciated.

What is your current working directory when calling the rake db:create command? Are you in the root of the Rails app?

You have to be in the root of the Rails app that you are creating. Currently you must be one step up.

Case I:

Check out your directory. If you are in same directory where your application is available then you wont' get is this message. You are getting this message because you are out of your application directory. To check you present directory you can use this command

pwd

Case II

You might missing your Rakefile. Check it out in your directory. For example,

$ ls
  app/
  bin/
  config/
  db/
  ...

If you don't find Rakefile then create new one. Puts this code

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

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

Blog::Application.load_tasks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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