2013-08-25 46 views
1

當我去heroku run rake耙中止,下一行表示,Don't know how to build task 'default'Heroku跑耙什麼不知道如何建立任務'默認'是什麼意思?

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>' 

這個錯誤是什麼意思?

+1

但你想要做什麼? – techvineet

+0

我去了一個位於heroku'random.heroku.com/refinery'的子目錄,我能夠創建一個用戶帳戶。但根路徑顯示頁面不存在錯誤。也似乎缺乏資產,因爲儀表板中的一些CSS已關閉。閱讀@dax鏈接的'Rake'文檔,並嘗試以下內容:'heroku運行rake路由''heroku運行rake資源:預編譯''heroku運行rake db:migrate'但沒有任何東西 – Patrick

回答

2

Rake是一個實用程序的名稱 - 查看更多信息here - 因此您不能只調用該實用程序。這就像打開你的網絡瀏覽器,並期望它自己沒有指示地爲你做點什麼。

嘗試運行下列操作之一:

heroku run rake db:create

heroku run rake db:schema:load

git push heroku master <確保你已經被推任何你想之前在Heroku上顯示你的github上運行此命令。

+0

或'heroku run rake db :如果OP在其數據庫中有數據,則遷移。 – j03w

+0

冉建議所有的命令,但該應用程序仍然顯示你正在尋找的頁面不存在 – Patrick

+0

實際上,這些命令可能無法解決你的問題 - 他們只是指出什麼'rake'是什麼,以及你的問題來了從。你應該閱讀我在答案中鏈接到的文檔 – dax

0

運行rake任務的基本語法是:

rake [taskname] 

如果不指定TASKNAME,耙將嘗試執行一個名爲default的特殊任務。您可以指定默認的任務命名或默認鏈接的任務是這樣的:

task :default => "taskname" 

,因爲沒有默認在您耙文件,您收到此錯誤指定的任務。

我想你試圖將你的數據庫部署到heroku。對於剛剛運行:

heroku run rake db:migrate