在使用带有 ruby 1.8.6 的 rails 2.0.2 使用旧应用程序时,遇到以下问题......
当我尝试执行任何 rake(v 0.8.3) 命令时 { 例如。耙路线}。
rake aborted!
Don't know how to build task 'routes'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1706:in `[]'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:2018:in `invoke_task'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_excetion_handling'
~/.rvm/gems/ruby-1.8.6-p420@rails202/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
~/.rvm/gems/ruby-1.8.6-p420@rails202/bin/rake:31
最初没有 rakefile,我添加了一个,内容如下
# 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