Skip to content

Instantly share code, notes, and snippets.

@grosser
Last active Dec 12, 2015
Embed
What would you like to do?
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