Skip to content

Instantly share code, notes, and snippets.

@indirect
Created November 16, 2010 16:45
Show Gist options
  • Save indirect/b8d47d4ca590e7b00539 to your computer and use it in GitHub Desktop.
Save indirect/b8d47d4ca590e7b00539 to your computer and use it in GitHub Desktop.
[andre ~/sw/gems/bundler-testcases/i850]$ cat Gemfile
gem "rack"
[andre ~/sw/gems/bundler-testcases/i850]$ dbundle install
Using rack (1.2.1)
Using bundler (1.0.5)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[andre ~/sw/gems/bundler-testcases/i850]$ cat test.rb
require 'rubygems'
require 'bundler/setup'
puts "With env: #{ENV['BUNDLE_GEMFILE']}"
Bundler.with_clean_env do
puts "With clean: #{ENV['BUNDLE_GEMFILE']}"
end
[andre ~/sw/gems/bundler-testcases/i850]$ echo $BUNDLE_GEMFILE
[andre ~/sw/gems/bundler-testcases/i850]$ ruby test.rb
With env: /Users/andre/sw/gems/bundler-testcases/i850/Gemfile
With clean:
@indirect
Copy link
Author

Sorry, I don't understand your question. What do you want to be able to do?

@ahamid
Copy link

ahamid commented Feb 14, 2011

From an application, load code which may itself have distinct dependencies described in separate Gemfiles. Plugins are a canonical example - it would be nice to be able to distribute plugins with 'bundle install --deployment' dependencies which can be loaded from the parent application without requiring all possible plugin dependencies to be added to the app Gemfile a priori.

@indirect
Copy link
Author

No, unfortunately that's not possible. The ruby interpreter is only able to load a single set of libraries, which is why Bundler has to resolve the entire dependency graph before the interpreter even starts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment