Skip to content

Instantly share code, notes, and snippets.

@comboy
Created May 15, 2011 13:55
Show Gist options
  • Save comboy/973177 to your computer and use it in GitHub Desktop.
Save comboy/973177 to your computer and use it in GitHub Desktop.
bundler env problem
# A/Gemfile
gem 'thor'
# A/test.rb
require 'rubygems'
require 'bundler/setup'
system("cd ../B && bundle show")
# Now this system command shows:
#
# Gems included by the bundle:
# * bundler (1.0.10)
# * thor (0.14.6)
#
# which are gems for directory A, not B
#
# If you however comment out "require 'bundler/setup'", it will show proper output, for directory B that is:
#
# Gems included by the bundle:
# * bundler (1.0.10)
# * git (1.2.5)
#
# UPDATE: Passing BUNDLE_GEMFILE="Gemfile" seems to help for showing them,
# it still won't install them properly however (tried BUNDLE BUNDLE_APP_CONFIG too).
#
# How does that bundler even know that it is run from within another application using bundler? How?
# B/Gemfile
gem 'git'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment