I got a working Rails App (3.1.1). Now I wrote a runner (saved in app folder). When starting the runner with: rails r app/delete_old_addresses.rb
it dumps:
/Users/andreas/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.1/lib/rails/commands/runner.rb:49:in 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:in 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:in 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
'
Any ideas why? My Webapp works perfectly fine.
The runner looks like this: class DeleteOldAddresses < ActiveRecord::Base end