-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to deploy when bundled version of Rake does not match installed version #31
base: develop
Are you sure you want to change the base?
Conversation
Currently I'm of the opinion that rvm and bundler are both doing the wrong thing by forcing any application or tool which uses binaries in their environments to begin wrapping or prefixing all calls with "bundle exec" and "rvm exec" (and sometimes both). I generally oppose modifying a general purpose tool to work around defects in poorly designed software. I've seen a couple of requests wanting a custom rake re-definition, but I'm aware of many users of both bundler and rvm who seem to be getting by without such a feature. I'm not clear what the difference is in these usage models so I'm hesitant to add features to whiskey disk to support a minority use case that I'm not convinced is a "good" use case. For what it's worth, I'm more inclined to support your usage #1 than your usage #2. Introspecting into the behavior of a tool like bundler from afar seems a recipe for headaches, or at least breakage, especially given the track-record of bundler development. I welcome more input on this topic, certainly. |
Thank you very much for your input. Let me highlight why this is an important feature to have. The problem is that deployment of one or more Bundler-enabled applications to the same server has a very high chance of introducing dependencies on different versions of Rake. If this happens, it is impossible to use Whiskey Disk in a sane way. The only alternative that I can see is to add relative paths to the To make these kinds of deployments work, there should be some way to make Whiskey Disk Bundler aware. I agree with your preference for option 1. I've attached two commits. One implements the feature (+ tests), the other adds the configuration option to the documentation. It would be great if this feature can make it into Whiskey Disk, especially since Bundler is used in Rails 3 applications by default. |
Rolf -- thanks for the code. In researching it a bit more, I believe the reason most people don't hit this issue is that most people aren't using different versions of rake for different projects (which allows them to perform bundler incantations in the Rakefile without using 'bundle exec'). I'll do some additional work with this and land it as soon as I can (I would prefer to use the config filter chain to handle the defaulting, and I may want to go ahead and test it more thoroughly via the integration suite). Thanks! |
Thank you, Rick! You're quite right -- dependencies on different versions of Rake is a problem that has started to (re)appear the last couple of months now that Rake has seen some incremental updates. |
+1 I've bumped into this problem before and managed to fudge on by, but it keeps happening more and more. |
+1 |
1 similar comment
+1 |
I merged this in a while back to https://github.com/jesseadams/whisk in efforts to keep things caught up until the original author has time to revisit this project. |
I'm trying to deploy an application that uses Bundler. I'm able to install all required gems by doing a
bundle install
in thepost_setup_script
. Unfortunately, regardless of my installed bundle,rake deploy:post_setup
fails.This is a common problem when different applications on the same server have different bundled versions of
rake
. The solution as suggested is to usebundle exec rake
instead ofrake
. Unfortunately there seems no way to make Whiskey Disk perform the commandbundle exec rake deploy:post_setup
instead ofrake deploy:post_setup
.I'm struggling to work around this limitation. In my opinion it would be great if:
Whiskey Disk allows setting the
rake
command to something else, in this casebundle exec rake
; orWhiskey Disk checks for a Gemfile, and if it is present executes
bundle exec rake
instead ofrake
. This can be accomplished with something like:if [ -f Gemfile ]; then rake_cmd="bundle exec rake"; else rake_cmd="rake"; fi; $rake_cmd
I would be happy to write a patch for either solution. Please share what you think is the best approach for Whisky Disk; or perhaps a different solution entirely.