From: headius@... Date: 2020-03-30T18:45:04+00:00 Subject: [ruby-core:97629] [Ruby master Feature#16744] Flag to load current bundle without using bundle exec Issue #16744 has been reported by headius (Charles Nutter). ---------------------------------------- Feature #16744: Flag to load current bundle without using bundle exec https://bugs.ruby-lang.org/issues/16744 * Author: headius (Charles Nutter) * Status: Open * Priority: Normal ---------------------------------------- The `bundle exec` command is used by Ruby users primarily to start up a Ruby command or application with only its specific locked dependencies wired up. Unfortunately to do this it currently double-launches, executing a second Ruby command and doubling the base startup time for these use cases. With Bundler becoming part of the standard library, it seems a good time to add support for doing what `bundle exec` does without requiring a relaunch. For many years, JRuby has implemented the `-G`/`--gemfile` flag which requires in `bundler/setup` before user code starts, eliminating the need to bundle exec in these situations. https://github.com/jruby/jruby/commit/ea0eed02b4eb57c2198afa9fd47f94bc46cfc69f This is based on the same flags in Rubinius: https://github.com/rubinius/rubinius/commit/edc94f2e3a61d8c94031a942b2024c6c5aa3ea94 There's at least one more commit later on in Rubinius that fixes some interations between `-G` and `-S`. Obviously this does not eliminate `bundle exec` use cases where the target command is not a Ruby command, but that is a very specific (and rather strange to me) feature. The majority of use cases are booting up a Ruby command, for which this implementation o `-G` There may be different or additional ways that `bundle exec` attempts to isolate the subcommand's environment and dependencies, but I believe requiring `bundler/setup` at boot comes pretty close. See also this bug report where I suggest using JRuby's embedding APIs to do `bundle exec`. We very much want to help eliminate this double-launching, one way or another. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>