Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

viuginick1
Copy link
Collaborator

No description provided.

@alflanagan
Copy link

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

@viuginick1
Copy link
Collaborator Author

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
Copy link

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

@viuginick1
Copy link
Collaborator Author

@alflanagan Can you attach your gem list result please?

@deivid-rodriguez
Copy link

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
Copy link

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

@deivid-rodriguez
Copy link

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

@viuginick1 viuginick1 merged commit 2f80e57 into ruby-debug:master Apr 14, 2020
@deivid-rodriguez
Copy link

Thank you @viuginick!

@stanhu
Copy link

stanhu commented Apr 22, 2020

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?

@viuginick1
Copy link
Collaborator Author

@stanhu done

@stanhu
Copy link

stanhu commented Apr 23, 2020

Thank you!

terrchen pushed a commit to terrchen/gitlab that referenced this pull request Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants