Last Updated: July 08, 2016
· ometa

Rake task to call a Rails controller method

Here's a Rails rake task that calls a particular endpoint without having to actually call a worker like unicorn.

namespace :controller do
  desc "Call the package endpoint"
  task :package => [:environment] do
    app =
    app.get "/package"

1 Response
Add your response

Thanks for this. When running I get
NoMethodError: undefined methoddebug' for nil:NilClass`
Any idea why?

over 1 year ago ·