I should have been more clear in the first place, I am actually trying to cap deploy another application from Rails, so it is trying to load a deploy.rb that is not in the RAILS_ROOT.
In my rspec spec, if I load the Capfile first, then the external deploy.rb, attempt to execute 'staging deploy' in Rails, I get the strange error: ArgumentError in 'MMD::Actions::Cap should run capistrano tasks' wrong # of arguments(1 for 0) Which claims to coming from the call execute_requested_actions (config), I traced it up to invoke_task_directly method in Capistrano::Configuration::Execution, but am not sure what is causing it. Now, if I actually try and run the deploy from Rails, I get a different error than the above: capistrano/configuration/namespaces.rb:97:in `task': defining a task named `tail' would shadow an existing method with that name (ArgumentError) which is happening at the method call to load_recipes(config) I have been rooting around the Webistrano and Capistrano source, but can not seem to get this sorted. Any more pearls of wisdom? thanks, Michael On Feb 12, 9:27 pm, Jamis Buck <[email protected]> wrote: > You need to load #{RAILS_ROOT}/Capfile, not > #{RAILS_ROOT}/config/deploy.rb. Capfile loads both the default deploy > recipes, as well as your app's deploy.rb > > - Jamis > > On 2/12/09 7:23 PM, Michael Guymon wrote: > > > Hello Capistranians, > > > I am trying to trigger a deploy from a Rails app using > > Capistrano::CLI, similar to what Webistrano is doing. I have a test > > cap file -http://pastie.org/private/kmpdjoufaaw1dz2iwogathat works > > using 'cap staging deploy' but when attempting to run it directly in > > the rails instance, gives the error 'the task `deploy' does not exist' > > > The execution of 'staging mmd:echo' does work in the rails instance, > > and dumps out the variables, namespaces, and tasks information. > > > Calling the deploy in rails happens by a lib that includes > > Capistrano::CLI::Execute, Capistrano::CLI::Options, > > setting the @option > > > @options = { > > :recipes => ['/absolute/path/to/deploy.rb'], > > :actions => ['staging', 'deployer'], # or ['staging', > > 'mmd:echo'] > > :vars => [], > > :pre_vars => {}, > > :verbose => 3 } > > > and calling > > > config = instantiate_configuration > > set_pre_vars(config) > > load_recipes(config) > > > config.trigger(:load) > > execute_requested_actions(config) > > config.trigger(:exit) > > > which run successfully for 'staging mmd:echo', but fails for 'staging > > deploy' > > > Any help would be greatly appreciated. > > > thanks, > > Michael > > > Below is the ouput of the mmd:echo task, which is the same for > > manually runing cap and running in rails > > > -- variables -- > > ssh_options: Hash.class > > logger: Capistrano::Logger.class > > default_environment: Hash.class > > default_run_options: Hash.class > > password: cap test password > > username: cap test user > > scm: subversion > > keep_releases: Fixnum.class > > runner: Proc.class > > application: test app > > user: user > > repository: a repo > > scm_username: scm username > > scm_password: scm password > > dbuser: dbuser > > dbpass: dbpass > > --------------- > > > -- tasks -- > > invoke > > shell > > staging > > ---------------- > > > -- namespaces -- > > ey_logger > > db > > ferret > > mongrel > > nginx > > slice > > deploy > > sphinx > > acts_as_sphinx > > thinking_sphinx > > ultrasphinx > > bdrb > > memcached > > solr > > monit > > tomcat > > juggernaut > > passenger > > apache > > mmd > > ---------------- > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
