雖然與舊的應用程序工作使用Rails 2.0.2與1.8.6紅寶石,讓下面的問題......錯誤與運行耙命令
當我嘗試執行任何耙(V 0.8.3)命令{例如, 。耙路線}。
rake aborted!
Don't know how to build task 'routes'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1706:in `[]'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:2018:in `invoke_task'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_excetion_handling'
~/.rvm/gems/[email protected]/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
~/.rvm/gems/[email protected]/bin/rake:31
最初沒有Rake文件,我增加了一個具有下列內容
# 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__)
require 'rake'
XXX::Application.load_tasks
我不敢相信這在Rails 2應用程序中起作用,因爲應該沒有'config/application.rb'並且沒有'XXX :: Application'。 因此,請檢查PriteshJ的答案並使用他的Rails 2 rake文件。另外請確保調用文件'Rakefile'而不是'rakefile' – severin 2012-08-10 12:36:31