虽然与旧的应用程序工作使用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