Skip to content

Instantly share code, notes, and snippets.

@grosser
Last active December 12, 2015 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grosser/4688543 to your computer and use it in GitHub Desktop.
Save grosser/4688543 to your computer and use it in GitHub Desktop.
Bundeling the same project with rails 2 and rails 3 (multiple gem versions but same gemfile) ``` ln -s Gemfile Gemfile.rails3 bundle BUNDLE_GEMFILE=Gemfile.rails3 bundle ``` using vendor/cache ? -> save disc space: ``` cd vendor/cache_rails3 ls ../cache | pru '%x{rm #{self} && ln -s ../cache/#{self}} if File.exist?(self)' ```
rails3 = ENV["BUNDLE_GEMFILE"].to_s.include?("rails3")
...
if rails3
# make bundler use a different cache dir
class << Bundler
def app_cache
root.join("vendor/cache_rails3")
end
end
Bundler::Runtime.class_eval do
def cache_path
Bundler.app_cache
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment