I know I’ve had this working several months ago:
http://wiki.rubyonrails.com/rails/pages/HowToUseActiveRecordThroughStandAloneScript
IE:
- #!/usr/bin/env ruby
- RAILS_ENV = ‘production’
- require File.dirname(FILE) + ‘/…/config/boot’
- @u = User.find( :all )
ruby test.rb
test.rb:5: uninitialized constant User (NameError)
(The User model does exist, so that’s not the problem) …but I can no
longer get it to work (I’ve tried it locally and on my dedicated sever
across several projects). Any ideas?