Search code examples
rubypadrino

How to run a script in a padrino context by passing the script path to padrino


How to run a script in a padrino context by passing the script path to padrino? I see that similar feature is available in rails: Executing Ruby script in an Rails application

The padrino website: http://www.padrinorb.com/guides/development-commands says this can be done by running

$ padrino r script/my_script.rb

But I get the error :

Could not find task "r".

Solution

  • cat script/my_script.rb | padrino console
    

    This worked for me