nadarei/mina — pull request #39 by Arcath (2012-08-06 13:42:39+00:00)
Title: Rbenv

tl;dr Makes life much easier for those of us using rbenv.

The problem was that ~/.bash_profile wasn't being pulled in which required the use of `bundle_bin` to get bundler to work and in some cases even resulted in the ruby command not being found, which was the case on a new production server I've had to setup up.

This change causes `source ~/.bash_profile` to be added as the first command run in the ssh session which results in:

$ mina deploy --verbose

-----> Loading rbenv
$ source ~/.bash_profile

-----> Creating a temporary build path
$ touch "deploy.lock"

It also adds a task for checking the ruby version (for debugging only):

invoke :'rbenv:ruby_version'

which appears like this in the output:

-----> Checking Ruby version
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

For rbenv users this render the need for `bundle_bin` and any other patches redundant and only needs tem to add

require 'mina/rbenv'

to the top of their `config/deploy.rb`