Broken test when using rake 0.9.2 #90

merged 1 commit into from Aug 24, 2011

3 participants


tests/recipes_test fails when ran with rake 0.9.2 with the following error:

  1) Error:
ArgumentError: defining a task named `symlink' would shadow an existing method with that name
    ./lib/capistrano/configuration/namespaces.rb:97:in `task'
    /Users/andrew/code/capistrano/lib/capistrano/recipes/deploy.rb:271:in `load'
    ./lib/capistrano/configuration/namespaces.rb:76:in `instance_eval'
    ./lib/capistrano/configuration/namespaces.rb:76:in `namespace'
    /Users/andrew/code/capistrano/lib/capistrano/recipes/deploy.rb:161:in `load'
    ./lib/capistrano/configuration/loading.rb:172:in `load_from_file'
    ./lib/capistrano/configuration/loading.rb:89:in `load'
    ./lib/capistrano/configuration/loading.rb:86:in `load'
    ./lib/capistrano/configuration/loading.rb:86:in `each'
    ./lib/capistrano/configuration/loading.rb:86:in `load'
    /Users/andrew/code/capistrano/test/recipes_test.rb:13:in `test_current_releases_does_not_cause_error_on_dry_run'
    /Users/andrew/.rvm/gems/ruby-1.8.7-p352/gems/mocha-0.9.12/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:22:in `__send__'
    /Users/andrew/.rvm/gems/ruby-1.8.7-p352/gems/mocha-0.9.12/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:22:in `run'

This is because rake 0.9.2 has a method called symlink which causes all_methods to wrongly suggest that capistrano already has a task defined called symlink.

In practise this doesn't effect the way that capistrano works because it is ran as a standalone command line app and never mixes methods with other libraries, but it's not ideal.

The following patch simply locks the development dependency of rake to 0.8.7 which sorts the problem for the moment and will get travis-ci working again.

@leehambley leehambley merged commit 7d2598f into capistrano:master Aug 24, 2011
Capistrano member

@sunaku are you using the --pre gem?


Not according to my Gemfile.lock:

capistrano (2.9.0)
  net-scp (>= 1.0.0)
  net-sftp (>= 2.0.0)
  net-ssh (>= 2.0.14)
  net-ssh-gateway (>= 1.1.0)
rake (

As hinted in my workaround in #140, Rake::DeprecatedObjectDSL causes the conflict.

Capistrano member

Try the --pre gem. That is 2.10.0.pre, pushed to Rubygems December 12, 2011

Capistrano member

(and, read the release notes, they're important)


💡 I see what you mean now. Any pointer to the release notes? There's no 2.10.0 entry in the CHANGELOG file and no similarly named Git branch and googling "capistrano release notes" brings up old 2009 results from rubyforge. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment