1

当我去heroku run rakeRake 的时候被中止了,下一行说,Don't know how to build task 'default'

heroku run rake --trace了,得到了

Running `rake --trace` attached to terminal... up, run.3479
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these     plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
Don't know how to build task 'default'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task_manager.rb:49:in `[]'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:148:in `invoke_task'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'

这个错误是什么意思?

4

2 回答 2

2

Rake是实用程序的名称 -在此处查看更多信息- 因此您不能只调用实用程序。这就像打开您的网络浏览器并期望它自己为您做某事而无需任何指示。

尝试运行其中之一:

heroku run rake db:create

heroku run rake db:schema:load

git push heroku master< 在运行此命令 之前,请确保您已将要在 heroku 上显示的任何内容推送到您的 github 。

于 2013-08-25T06:49:49.070 回答
0

运行 rake 任务的基本语法是:

rake [taskname]

如果不指定任务名,rake 将尝试执行一个名为 default 的特殊任务。您可以指定名为 default 的任务或将任务与 default 链接,如下所示:

task :default => "taskname"

由于您的 rake 文件中没有指定默认任务,因此您会收到此错误。

我猜您正在尝试将数据库部署到heroku。为此运行:

heroku run rake db:migrate
于 2013-08-25T12:21:31.053 回答