Heroku Stack Setup SimpleWorker require Ruby 1.9+, but Heroku defaults to Ruby 1.8 by default so you either need to set the stack you want when creating your Heroku project or migrate to a more recent stack (easy either way). If creating a new Heroku project, use:
Of if you already have an app on Heroku, use:
More info on the available Heroku stacks. Installing the SimpleWorker Add-onTo use simple_worker on Heroku, install the simple_worker add-on:
Then follow the SimpleWorker add-on link for your application in the heroku UI to get your credentials. Configuring SimpleWorkerOnce you have your credentials for SimpleWorker, simply add the following to development.rb: ENV['SIMPLE_WORKER_TOKEN'] = 'YOUR TOKEN' ENV['SIMPLE_WORKER_PROJECT_ID'] = 'YOUR PROJECT ID' You don't need to add this to production.rb as Heroku will do that automatically. Tokens can be found on the API Tokens tab under the Account link. Your project ID can be found on the projects page. Then create a file at
That's all you need to do. Now it's time to make your first worker, follow the SimpleWorker on Rails instructions here. SimpleWorker and Heroku SharedDBAt present, Heroku does not allow external access to their shared database. We're working with them to get access to allow SimpleWorker jobs to connect to them but we're not there yet. If the shared database is too limiting, we suggest switching to a dedicated database or using something like Xeround, Amazon's RDS, MongoLab or MongoHQ, or one of the other add-on databases. Ping us if you have any questions here. |
Ruby > Getting Started >