runtime "ruby" # include postgresql and activerecord gem "pg" gem "activerecord" exec "pygments_worker.rb" # Merging models dir '../app/models/' remote
- gem “pg” and gem “activerecord” will package up the two gems as well as any dependencies of those two libraires into the __gem__ folder in the root directory
- exec “pygments_worker.rb” will package up pygments_worker.rb and execute this file when a worker is run
- dir ‘../../app/models’ means that we will go two directories up from our current directory which is the location of the worker file and then go into the app directory and package up the models folder into the root directory of the worker. You can see this here.
You can also pass an optional argument to this and change where the folder is saved. For example, if you would like to maintain the original folder structure, you can use dir ‘../../app/models’, ‘app’, the second optional argument ‘app’ indicates that you would like to save the models folder inside an app folder and save the app folder into the root directory of your worker. For more info, click here.
- remote or (full_remote_build true) means that for gems like ‘pg’ which requires building native extensions. We will build the native extension on iron.io server.
For more information on how to construct your worker file, you can find corresponding documentation here.