Re: [Rails] running model methods from command line

2012-07-01 Thread Scott Ribe
On Jul 1, 2012, at 5:37 AM, Nielson Rolim wrote: > Try create just a ruby script and include 'rubygems' and 'active_record': You might also want (for the connection follow what's in your database.yml): ActiveRecord::Base.establish_connection({ adapter: ... }) And you might want to require log

Re: [Rails] running model methods from command line

2012-07-01 Thread Nielson Rolim
Try create just a ruby script and include 'rubygems' and 'active_record': |#!/path/to/ruby ||require'rubygems'| |require'active_record'| You must include all the models you need also. Then give execute permission to your script: |chmod a+x myscript.rb| -- Nielson Rolim nielson.ro...@gmail.c

[Rails] running model methods from command line

2012-07-01 Thread bingo bob
hi chaps - i've got a project where I have very limited resources on the device rails runs on (raspberry pi) - basically i have rails server running… then periodically i fire off rails runner Model.method (from an external program on the device)…. all works fine but it's terribly slow - I think it