Skip to content
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

Regenerating binstubs in --destdir only works for gems already installed globally #5134

Closed
deivid-rodriguez opened this issue Dec 4, 2021 · 0 comments · Fixed by #7660
Closed

Comments

@deivid-rodriguez
Copy link
Member

If I have rake installed globally, this works:

$ gem list rake

*** LOCAL GEMS ***

rake (13.0.6)

$ rm -rf /tmp/foo && gem install rake --install-dir /tmp/foo && (echo "foo" > /tmp/foo/bin/rake) && ruby -Ilib setup.rb --destdir /tmp/foo --prefix / && head -1 /tmp/foo/bin/rake
Fetching rake-13.0.6.gem
Successfully installed rake-13.0.6
1 gem installed
  Successfully built RubyGem
  Name: bundler
  Version: 2.3.0.dev
  File: bundler-2.3.0.dev.gem
Bundler 2.3.0.dev installed
RubyGems 3.3.0.dev installed
Regenerating binstubs
Regenerating plugins



------------------------------------------------------------------------------

RubyGems installed the following executables:
	/tmp/foo/bin/gem
	/tmp/foo/bin/bundle
	/tmp/foo/bin/bundler

#!/Users/deivid/.rbenv/versions/3.0.3/bin/ruby

But if I remove the globally installed rake, the rake binstub in the --destdir is no longer regenerated properly:

$ gem uninstall rake --executables --force
Removing rake
Successfully uninstalled rake-13.0.6

$ rm -rf /tmp/foo && gem install rake --install-dir /tmp/foo && (echo "foo" > /tmp/foo/bin/rake) && ruby -Ilib setup.rb --destdir /tmp/foo --prefix / && head -1 /tmp/foo/bin/rake
Fetching rake-13.0.6.gem
Successfully installed rake-13.0.6
1 gem installed
  Successfully built RubyGem
  Name: bundler
  Version: 2.3.0.dev
  File: bundler-2.3.0.dev.gem
Bundler 2.3.0.dev installed
RubyGems 3.3.0.dev installed
Regenerating binstubs
Regenerating plugins



------------------------------------------------------------------------------

RubyGems installed the following executables:
	/tmp/foo/bin/gem
	/tmp/foo/bin/bundle
	/tmp/foo/bin/bundler

foo

Originally posted by @deivid-rodriguez in #5053 (comment)

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 a pull request may close this issue.

1 participant