Closed gido closed 6 years ago
Hi @gido,
I had this issue yesterday and as I didn't have too much time to dig into the code and see what's the real problem here, my workaround was to use the "old" way:
invoke 'symfony:console', 'doctrine:migrations:migrate', '--no-interaction', 'db' instead of the symfony:console(blabla) thing.
Hope this works for you in the meantime, I'll try to find out the real reason if nobody gets there before,
Cheers,
ps: after another try, it looks like enclosing the symfony:console command in a on roles clause, it works. I've read that has something to do with a syntax change in capistrano 3.x (sorry, I have almost no experience with ruby).
This works for me as well:
namespace :deploy do
desc "Dumping assetic assets"
task :assetic_dump do
on roles(:all) do
symfony_console "assetic:dump"
end
end
end
Thanks for the reply. I used invoke
and it work.
I wasn't aware about the role requirement (but it's a good thing to specify it in all case ;-)). I will update my recipes and try with this change.
Have same issue here, invoke save my life! thanks!
# OSX Sierra
# ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
# Capistrano Version: 3.8.1 (Rake Version: 12.0.0)
GEM
remote: https://rubygems.org/
specs:
airbrussh (1.2.0)
sshkit (>= 1.6.1, != 1.7.0)
capistrano (3.8.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-composer (0.0.6)
capistrano (>= 3.0.0.pre)
capistrano-file-permissions (0.1.1)
capistrano (~> 3.1)
capistrano-symfony (0.4.0)
capistrano (~> 3.1)
capistrano-composer (~> 0.0.3)
capistrano-file-permissions (~> 0.1.0)
i18n (0.8.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
rake (12.0.0)
sshkit (1.13.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
PLATFORMS
ruby
DEPENDENCIES
capistrano
capistrano-composer
capistrano-file-permissions
capistrano-symfony
sshkit
BUNDLED WITH
1.15.0
Enclosing the symfony:console command in a on roles clause (which is the recommended way) solve the issue.
I'm closing it.
@gido I'm using:
# migrations.rake
namespace :deploy do
task :migrate do
on roles(:app) do
symfony_console('doctrine:migrations:migrate', '--no-interaction')
end
end
end
As per your advice, yet still it is not finding this command. I also tried the "invoke" way, but that gives me the same result.
Caused by:
NoMethodError: undefined method `symfony_console' for #<SSHKit::Backend::Netssh:0x00007fcbe091f358>
I am on version 2.0.0. Could there be a problem after all?
@ChristianVermeulen strange. The symfony_console is still here in 2.x.
Do you required the full recipe in your Capfile ?
# Capfile
# ...
require "capistrano/symfony"
The README mention this:
But when I use
symfony_console
in my own task I get this error:I'm using
capistrano-symfony rc2
andcapistrano 3.5.0
. The CHANGELOG mention a change aboutsymfony_console
but I'm not sure to understand it.Thanks for your help,