Say I wanted to run 'User.all.each{|u| u.destroy}' from a shell script called killallusers.sh. How can I call Rails console commands from the shell or from an executable script?
Either write it as a Rake task, or use Rails "runner".
Inside your shell script put the appropriate rake or runner command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With