0

I am trying to call a php script after deployment in my capistrano script by I am getting the below error if I try execute

NoMethodError: undefined method `execute' for main:Object

If I try run I get the following error

NoMethodError: undefined method `run' for main:Object

Below is the script which I am using

namespace :deploy do
        task :run_sql do
            run  "php -q /home/mydir/public_html/index.php argumen1 argument2 argument3 argument4"  
        end
end
after :deploy, "deploy:run_sql"

any suggestions what I am doing wrong?

PS: I will execute this one after deploy once my code gets deployed and this php file is on the server where I am deploying to.

Arihant Godha
  • 2,339
  • 2
  • 26
  • 50

1 Answers1

4

Your syntax is for 2.x version. Please refer here: undefined method `run' for main:Object

namespace :deploy do
  on roles :all do
    execute :php, "-q /home/mydir/public_html/index.php argumen1 argument2 argument3 argument4"
  end
end
Community
  • 1
  • 1
shivam
  • 16,048
  • 3
  • 56
  • 71