简体   繁体   中英

Why am I getting a resource not found error when setting workers on heroku?

This is a snippet of my code trying to turn on the number of workers on my heroku instances:

heroku = Heroku::Client.new(ENV['HEROKU_USER'], ENV['HEROKU_PASS'])
puts "created the client"
heroku.set_workers(ENV['HEROKU_APP'], 1)
puts "set workers to 1"

I stored all the values, HEROKU_USER, HEROKU_PASS, and HEROKU_APP as a heroku config:add variable

But when I run this cron task, I end up with an error:

"Rake Aborted!  Resource Not Found"

What do I need to do? This snippet had worked correctly till I wanted to move the keys out of the repository after changing them and put just into a config var on heroku.

See my answer here: Heroku & Delayed Job - Autoscale Branch - RestClient::ResourceNotFound

Make sure those environment variables exist and are set properly. That's what tripped up the poster of the question I linked above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM