Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle viz fails with NoMethodError #3217

Closed
hauleth opened this issue Oct 18, 2014 · 12 comments
Closed

bundle viz fails with NoMethodError #3217

hauleth opened this issue Oct 18, 2014 · 12 comments

Comments

@hauleth
Copy link

hauleth commented Oct 18, 2014

After running bundle viz I get this:

/home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/graph.rb:38:in `block in _populate_relations': undefined method `runtime_dependencies' for nil:NilClass (NoMethodError)
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/2.1.0/set.rb:263:in `each_key'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/2.1.0/set.rb:263:in `each'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/graph.rb:37:in `_populate_relations'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/graph.rb:19:in `initialize'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/cli/viz.rb:11:in `new'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/cli/viz.rb:11:in `run'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/cli.rb:321:in `viz'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/vendor/thor/command.rb:27:in `run'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/vendor/thor/base.rb:440:in `start'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/cli.rb:9:in `start'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/bin/bundle:20:in `block in <top (required)>'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
    from /home/hauleth/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/bin/bundle:18:in `<top (required)>'
    from /home/hauleth/.rbenv/versions/2.1.2/bin/bundle:23:in `load'
    from /home/hauleth/.rbenv/versions/2.1.2/bin/bundle:23:in `<main>'

Any idea what is wrong?

@hauleth hauleth changed the title bundle viz fails bundle viz fails with NoMethodError Oct 18, 2014
@indirect
Copy link
Member

Not super sure, no. It seems like you somehow have a dependency that's nil, but I'm not sure how that would happen. Can you follow ISSUES and report back?

@hauleth
Copy link
Author

hauleth commented Oct 19, 2014

Whole bundle env output is avalable here: https://gist.github.com/hauleth/5fe4bc56548bfca60b35

@FUT
Copy link

FUT commented Nov 27, 2014

I have exactly the same error.

@simi
Copy link
Member

simi commented Nov 27, 2014

Reproducable with @hauleth 's gemfile with RubyGems 2.4.4. RubyGems 2.2.2 works fine with the same Gemfile. Gemfile generated by rails _4.1.8_ new works fine for both RubyGems versions.

minimal Gemfile to reproduce:

source 'https://rubygems.org'
gem 'rails', '4.2.0.beta2'

rails 4.1.8 works fine

investigating deeper...

@simi
Copy link
Member

simi commented Nov 27, 2014

It is caused by globalid gem since it is requiring activesupport (>= 4.1.0) and it is not satisfied by activesupport (4.2.0.beta2) since rubygems/rubygems@84e8d9f.

/cc @drbrain @indirect

indirect referenced this issue in rubygems/rubygems Nov 27, 2014
Previously RubyGems would activate prerelease gems with Kernel#gem.
This behavior was undefined and wrong as use of prerelease gems should
always be explicitly opt-in.

Now you must specify prerelease requirements to use prerelease gems.

Fixes #938
@aprescott
Copy link
Contributor

I have this issue. I'm not quite sure I follow why this is happening, but is there a reliable workaround?

@fotanus
Copy link
Contributor

fotanus commented May 6, 2015

@aprescott Can you fill an issue with the recommended format ? It is the easiest way to have all requirements to reproduce it and possibly fix it.

Edit: If by any chance you are using rails 4.2.0.beta2 and can change it to rails.4.2.0 it will work. Tested on rubygems 2.4.6 and ruby 2.2.0

@aprescott
Copy link
Contributor

My issue is basically exactly as described here, with potentially different versions. ruby 2.2.2p95, rubygems 2.4.6, bundler 1.9.5, rails 4.2.1. I can open another issue, though, if the duplication is fine. (I'd just be linking to this issue anyway.)

@indirect
Copy link
Member

indirect commented May 6, 2015

The file https://github.com/bundler/bundler/blob/master/ISSUES.md has specific instructions for what we need to know in order to try to reproduce your problem. Please read the file and follow the instructions.

On May 6, 2015, at 7:25 PM, Adam Prescott notifications@github.com wrote:

My issue is basically exactly as described here, with potentially different versions. ruby 2.2.2p95, rubygems 2.4.6, bundler 1.9.5, rails 4.2.1. I can open another issue, though, if the duplication is fine. (I'd just be linking to this issue anyway.)


Reply to this email directly or view it on GitHub #3217 (comment).

@aprescott
Copy link
Contributor

Apologies for the noise. I dug into this some more and I can't provide more than what you already know with the commit linked in this issue. It's a similar problem with an rc1 pre-release dependency and dependency.to_spec returning nil within _populate_relations. Specifically, backbone-on-rails 0.9.9.0 using eco 1.0.0, which uses eco-source 1.1.0.rc.1 (whose to_spec returns nil). I'll shut up!

@aprescott
Copy link
Contributor

I believe this is fixed now and can be closed.

@andywenk
Copy link

andywenk commented Jul 5, 2015

just for the record and it may help someone. I had this output:

bundle viz                                                                                  ✭
――― ERROR REPORT TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――
- What did you do?
- What did you expect to happen?
- What happened instead?

Error details

    NoMethodError: undefined method `runtime_dependencies' for nil:NilClass
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/graph.rb:39:in `block in _populate_relations'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/set.rb:283:in `each_key'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/set.rb:283:in `each'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/graph.rb:38:in `_populate_relations'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/graph.rb:20:in `initialize'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/cli/viz.rb:11:in `new'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/cli/viz.rb:11:in `run'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/cli.rb:336:in `viz'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/cli.rb:10:in `start'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/bin/bundle:20:in `block in <top (required)>'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
    /Users/andwen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/bin/bundle:18:in `<top (required)>'
    /Users/andwen/.rbenv/versions/2.2.2/bin/bundle:23:in `load'
    /Users/andwen/.rbenv/versions/2.2.2/bin/bundle:23:in `<main>'

Environment

    Bundler   1.9.4
    Rubygems  2.4.5
    Ruby      2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
    GEM_HOME  /Users/andwen/project/sumcumo/ace/vendor/ruby/2.2.0
    GEM_PATH
    Git       2.4.5

Bundler settings

    path
      Set for your local app (/Users/andwen/project/sumcumo/ace/.bundle/config): "vendor"
    disable_shared_gems
      Set for your local app (/Users/andwen/project/sumcumo/ace/.bundle/config): "1"
    cache_all
      Set for your local app (/Users/andwen/project/sumcumo/ace/.bundle/config): "true"
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=undefined+method+%60runtime_dependencies%27+for+nil%3ANilClass&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new

After upgrading to bundler 1.10.5, the problem was gone and the graphic was created.

Cheers

Andy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants