Last active
December 12, 2015 01:08
-
-
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)'
```
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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