Skip to content

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

Closed
@deivid-rodriguez

Description

@deivid-rodriguez

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions