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

Closed
jwaldrip opened this Issue Nov 13, 2012 · 5 comments

Comments

Projects
None yet
4 participants

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>'
Contributor

carsomyr commented Nov 14, 2012

@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?

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 added a commit that referenced this issue Dec 10, 2012

@carsomyr carsomyr Fix issue #307 3100b91
Contributor

carsomyr commented Dec 10, 2012

I believe that this has been fixed.

carsomyr closed this Dec 10, 2012

mbajur commented Sep 30, 2013

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)
Owner

leehambley commented Sep 30, 2013

Use the master branch. And/or make sure you're using the bundled version of
Cap, and using bundler/etc.

Lee Hambley

http://lee.hambley.name/
+49 (0) 170 298 5667

On 30 September 2013 12:01, Mike Bajur notifications@github.com wrote:

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:inrun'
/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:inload'
/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:ineval'
/usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `

'
(See full trace by running task with --trace)


Reply to this email directly or view it on GitHubhttps://github.com/capistrano/capistrano/issues/307#issuecomment-25349268
.

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