rake db:migrate 对我不起作用

发布于 2024-09-12 00:28:49 字数 1309 浏览 3 评论 0原文

我收到此错误

 rake db:migrate (in
   /Users/john/Sites/my_app) rake aborted!
   Don't know how to build task
   'db:migrate'

当我跟踪错误时,我得到

rake aborted! Don't know how to build task 'db:migrate' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 
/usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19

My Rakefile is

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

I am getting this error

 rake db:migrate (in
   /Users/john/Sites/my_app) rake aborted!
   Don't know how to build task
   'db:migrate'

When I trace the error I get

rake aborted! Don't know how to build task 'db:migrate' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' 
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 
/usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19

My Rakefile is

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无声情话 2024-09-19 00:28:49

对于 Ruby on Rails 2.3,您的 Rakefile 末尾应该有以下附加行:

require 'tasks/rails'

For Ruby on Rails 2.3 you should have the following additional line at the end of your Rakefile:

require 'tasks/rails'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文