Rake: Don't know how to build task 'db::create'
I want to learn Ruby on Rails and have set up a test environment.
I've created a new rails app using "rails new Lab"
Then I got stuck at creating a database using "rake db::create":
henke@ubuntu:~/Rails Projects/Lab$ rake db::create --trace
(in /home/henke/Rails Projects/Lab)
rake aborted!
Don't know how to build task 'db::create'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/henke/.rvm/gems/ruby-开发者_运维技巧1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/henke/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/henke/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/henke/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
I've tried to use "rake db::migrate" as well, same error. When I look at "rake -T", both "db::create" and "db::migrate" appears in the list.
My enviroment:
- Ubuntu 10.10
- Ruby 1.9.2 (Using RVM in my home directory)
- Rails 3.0.5
- sqlite3-1.3.3
Any ideas? Please let me know if you need more information!
Use a single colon:
rake db:create
As an aside tip, avoid spaces in names of folders and file in *nix. While it may work mostly, sometimes some program will trip up and could make you wonder "why is this not working".
精彩评论