Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Configuration Trys to undefined methods from Namespace that dont exist. #307

Closed
jwaldrip opened this Issue · 5 comments

4 participants

@jwaldrip

Something is trying to undef a method that doesn't exist.

$ rs thin
/usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:47:in `undef_method': undefined method `logger=' for class `Capistrano::Configuration::Namespaces::Namespace' (NameError)
    from /Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:47:in `block in <class:Configuration>'
    from /Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:46:in `each'
    from /Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:46:in `<class:Configuration>'
    from /Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:22:in `<module:Capistrano>'
    from /Users/jwaldrip/dev/capistrano/lib/capistrano/configuration.rb:18:in `<top (required)>'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from /Users/jwaldrip/dev/capistrano/lib/capistrano.rb:3:in `<top (required)>'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
    from /Users/jwaldrip/dev/itriage3/config/application.rb:5:in `<top (required)>'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:53:in `require'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap'
    from /usr/local/Cellar/rbenv/0.3.0/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@carsomyr

@jwaldrip This is a piece of code that I recently touched. Could you describe the sequence of events that led to this, and why said code is wrong?

@jwaldrip

We upgrade Capistrano, from what I could see, methods were being collected from class to be undefined on the Namespace class. The issue was in our instance that the method wasn't actually defined on the namespace class so it blew up and we couldn't even start the application.

The fix checks to see if the method actually exists before removing it, and I extracted the functionality into a method so that it can be easily tested. I also added the test and confirmed that it is working as it should.

There is a pull request: #308

@carsomyr carsomyr referenced this issue from a commit
@carsomyr carsomyr Fix issue #307 3100b91
@carsomyr

I believe that this has been fixed.

@carsomyr carsomyr closed this
@mbajur

Hello, i'm using Rails 4.0.0 + ruby 2.0.0 + rvm-capistrano 1.5.0 and it looks like this issue is still there.

Capfile

require "rvm/capistrano"
require "rvm/capistrano/alias_and_wrapp"
require "bundler/capistrano"

load 'deploy'
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks

Error message:

cap aborted!
undefined method `instance' for Capistrano::Configuration:Class
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/capistrano.rb:7:in `<top (required)>'
/Users/michal/Workspace/*/*/Capfile:3:in `require'
/Users/michal/Workspace/*/*/Capfile:3:in `<top (required)>'
/Users/michal/.bundler/ruby/2.0.0/capistrano-78eb033290f7/lib/capistrano/application.rb:22:in `load_rakefile'
/Users/michal/.bundler/ruby/2.0.0/capistrano-78eb033290f7/lib/capistrano/application.rb:12:in `run'
/Users/michal/.bundler/ruby/2.0.0/capistrano-78eb033290f7/bin/cap:3:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
@leehambley
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.