lavmeiker / capistrano-wpcli

Provides command line tools to facilitate Wordpress deploy.
MIT License
117 stars 34 forks source link

What am I missing? #42

Open working-name opened 7 years ago

working-name commented 7 years ago

Hello there,

I followed the README and got the gem installed, it's available, however, when I try to run cap production wpcli:db:pull, I get

cap aborted!
Don't know how to build task 'wpcli:db:pull' (see --tasks)

I set up some of the paths in production.rb, the server has "wp" as a link to wp-cli.phar, and it runs fine when I try it manually.

What am I missing? Thanks.

Update: I have a feeling this is not compatible with later Capistrano 3 versions. Maybe it worked at some point, but now it's not even registering its tasks.

★ Update2: Capistrano 3.8 is loading lib/capistrano-wpcli.rb✨, which is empty. I just migrated the contents of lib/capistrano/wpcli.rb and updated the path:

# Load all tasks
files = Dir[File.join(File.dirname(__FILE__), 'capistrano/tasks', '*.rake')] 
files.each do |file|
  load file
end

It is now aware of the wpcli tasks.

jeremyzahner commented 7 years ago

Hi there! Glad you managed to get it working. Would you be so kind and think about adding a PR that would be able to handle both versions? That would be awesome!