Closed voxik closed 3 years ago
Bundler already has this feature, through bundle install --standalone
.
It sounds it might do what I proposed, but except of it, it does way more which prevents it use. Let me explain.
I have generated the application using system installed Ruby on Rails, therefore I have every required gem available on the system. I can do the following:
$ bundle install --local
Resolving dependencies...
Using rake 13.0.3
... snip ...
Bundle complete! 3 Gemfile dependencies, 44 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
But the --standalone
fails:
$ bundle install --local --standalone
Could not find rake-13.0.3 in any of the sources
Apparently, tries to do something unexpected. I don't want this feature to install anything. But maybe, I should rather report this as a bug against Bundler.
Bundler is on step away from being perfect and that would be when Bundler (and RubyGems) was completely from the application runtime.
Lets say we have this simple Rails
Gemfile
:This transforms into
Gemfile.lock
:But what is really needed for application runtime? Just properly initialized
$LOAD_PATH
. So theGemfile.lock
above could be transformed into lets sayGemfile.rb
:and Bundler also preloads the libraries by default, so there could also be:
This way, one could run the application later via e.g.
RUBYOPT="--disable-gems -r./Gemfile.rb rails server"