我得到了一個可以工作的Rails應用程序(3.1.1)。現在我寫了一個跑步者(保存在應用程序文件夾中)。 當啓動亞軍: 軌[R應用/ delete_old_addresses.rbRails Runner throwing:undefined局部變量或方法`app'for main:Object(NameError)
它轉儲:
/Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1。 1/lib/rails/commands/runner.rb:49:eval': undefined local variable or method
app'for main:Object(NameError) from /Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1 .1/lib/rails/commands/runner.rb:49:在eval' from /Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.1/lib/rails/commands/runner.rb:49:in
' from /Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.1/lib/rails/ commands.rb:63:require' from /Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.1/lib/rails/commands.rb:63:in
' from script/rails:6:in require' from script/rails:6:in
'
任何想法爲什麼?我的Web應用程序工作得很好。
亞軍看起來是這樣的: 類DeleteOldAddresses <的ActiveRecord :: Base的 結束
我的不好,應該開始跑步 rails r app/runners/delete_old_addresses.rb – KKK