ruby-debug / ruby-debug-ide

An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine.
https://www.jetbrains.com/ruby/features/ruby_debugger.html
Other
371 stars 83 forks source link

check if debase installed (already_installed doesn't work) #142

Closed ViugiNick closed 4 years ago

alflanagan commented 5 years ago

Has anybody looked at this? It seems to solve a common install problem, it seems a fix would be a high priority.

ViugiNick commented 5 years ago

Has anybody looked at this? It seems to solve a common install problem, it seems a fix would be a high priority.

Do you have a problem with offline installation or what kind of install problem?

alflanagan commented 5 years ago

I've created a rails project with rails new ..., then used bundle add --group=development ruby-debug-ide. This is an online installation. When I try to debug some ruby code in VS Code, I get

Uncaught exception: cannot load such file -- debase
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require'
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/ruby-debug-ide-0.6.1/lib/ruby-debug-ide.rb:9:in `<main>'
    /home/aflanagan/Devel/ruby/fred/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'

So bundle add --group=development debase solves the problem, it just seems like that shouldn't be necessary.

$ ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
$ rails -v
Rails 5.2.3
ViugiNick commented 5 years ago

@alflanagan Can you attach your gem list result please?

deivid-rodriguez commented 4 years ago

Hi!

We have removed Gem::DependencyInstaller#find_gems_with_sources from current rubygems master, so installation of ruby-debug-ide will be broken in the next rubygems release.

We don't want to break it, so I'll be reverting the removal, but we don't expect this method to be used by extensions, and on top of that, this PR is correct. Gem::DependencyInstaller#find_gems_with_sources uses Gem::Source::Local under the hood which look for gems in the CWD. So this check always returns false at the moment and the debase gem is always reinstalled.

The correct solution to do what you want is what this PR is proposing (dep.matching_specs.none?), but if you're ready to drop support for ruby 1.8 and ruby 1.9, the most correct and supported solution would be to remove the extension and add debase as a runtime dependency of ruby-debug-ide.

deivid-rodriguez commented 4 years ago

Also, the latter option I proposed would fix issues like #92 or #187.

deivid-rodriguez commented 4 years ago

@ViugiNick I'm happy to create a rebased version of this PR in case it helps moving it forward.

deivid-rodriguez commented 4 years ago

Thank you @ViugiNick!

stanhu commented 4 years ago

Thanks, this solved my problem. I checked out the v0.7.0 tag, picked this commit, built the gem, and installed it so that my dependency worked. Would someone mind releasing a new version?

ViugiNick commented 4 years ago

@stanhu done

stanhu commented 4 years ago

Thank you!