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

SharedHelpers.clean_load_path causes error in 2.3 #4837

Closed
kylekyle opened this issue Aug 4, 2016 · 3 comments
Closed

SharedHelpers.clean_load_path causes error in 2.3 #4837

kylekyle opened this issue Aug 4, 2016 · 3 comments

Comments

@kylekyle
Copy link

kylekyle commented Aug 4, 2016

The SharedHelpers.clean_load_path method looks like it was written to correct an issue Ruby 1.9, but is causing problems in Ruby 2.3. You can reproduce the issue using iruby-dependencies which uses bundler/inline to inject dependencies into Jupyter notebooks:

require 'iruby/dependencies'

dependencies do 
  gem 'httparty'
end

The block works the first time, but if you re-run the block (or run any other dependency block), you get the following backtrace:

NoMethodError: undefined method `map' for nil:NilClass
Did you mean?  tap
/usr/lib/ruby/2.3.0/rubygems/basic_specification.rb:141:in `full_require_paths'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:176:in `block in loaded_gem_paths'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:176:in `each'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:176:in `map'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:176:in `loaded_gem_paths'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:197:in `clean_load_path'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:12:in `setup'
/usr/lib/ruby/gems/2.3.0/gems/iruby-dependencies-2.0.4/lib/iruby/dependencies.rb:58:in `dependencies'
/usr/lib/ruby/gems/2.3.0/gems/iruby-dependencies-2.0.4/lib/iruby/dependencies.rb:80:in `dependencies'
(pry):8:in `<main>'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:355:in `eval'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:355:in `evaluate_ruby'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:323:in `handle_line'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:243:in `block (2 levels) in eval'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:242:in `catch'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:242:in `block in eval'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:241:in `catch'
/usr/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/pry_instance.rb:241:in `eval'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/backend.rb:66:in `eval'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/backend.rb:12:in `eval'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/kernel.rb:87:in `execute_request'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/kernel.rb:47:in `dispatch'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/kernel.rb:37:in `run'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/command.rb:70:in `run_kernel'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/lib/iruby/command.rb:34:in `run'
/usr/lib/ruby/gems/2.3.0/gems/iruby-0.2.9/bin/iruby:5:in `<top (required)>'
/usr/bin/iruby:23:in `load'
/usr/bin/iruby:23:in `<main>'

This is an edge case for sure, but it is not hard to imagine it creeping up in other applications. The clean_load_path method should either be updated to work in Ruby 2.3 or properly relegated to only those versions of Ruby it was originally intended for.

@kylekyle kylekyle changed the title SharedHelpers.clean_load_path causes in 2.3 SharedHelpers.clean_load_path causes error in 2.3 Aug 4, 2016
@indirect indirect mentioned this issue Aug 11, 2016
23 tasks
@segiddins
Copy link
Member

segiddins commented Sep 6, 2016

Is there a way to reproduce this without using iruby-dependencies?

@colby-swandale
Copy link
Member

ping @kylekyle

@colby-swandale
Copy link
Member

I'm closing this for now. If you're still experiencing your original issue don't be afraid to re-open this ticket.

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

No branches or pull requests

5 participants