Different ways of running ruby code in the heroku console

$ heroku run rails runner 'PurchaseOrderJob.new("1234565").perform'
$ heroku run "rails runner 'puts User.count'"

to run a LOCAL script onto your heroku application

$ cat your_script.rb | heroku run "rails runner -"

Which pipes your script into the rails runner command