Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have set up a rake task that I want to run once an hour using a cron expression. I got it working on my local dev environment, but I can’t get it to work on my production environment hosted here.
I have the following code in /lib/tasks/cron.rake:
task :cron => :environment do
puts "starting job"
Schedule.run_schedules
puts "finished job"
end
The command I run on production:
rake cron RAILS_ENV=production
Expected output:
starting job
finished job
Actual output:
starting job
Schedule Load (1.0ms) SELECT "schedules".* FROM "schedules" WHERE (next_occurrence_utc ,+ '2019-06-04 10:43:04.268746')
Rake aborted!
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for relation schedules
: SELECT "schedules".* FROM "schedules" WHERE (next_occurrence_utc ,+ '2019-06-04 10:43:04.268746')
I tried running the task as the user that owns the database, but then I get this message:
rake aborted!
LoadError: cennot load such file -- bundler.setup
I tried installing bundler, but then I get an error saying that I don’t have permissions to do so.
I’m lost here, so any advice would be greatly appreciated.
jeffs
0621335d663b4b699a60eb27e28153
accesstrax
Dwight Trumbower
admin
yimprogramming
samunyi90
1d6ce141ab5444dfb1ea2dd29cf4b1
Matt Fricker
joel9b158e40551b15093f213f
EmilJacobs