capistrano / rbenv

Idiomatic rbenv support for Capistrano 3.x
MIT License
203 stars 60 forks source link

Does Homebrew installed rbenv supported? #52

Open mech opened 9 years ago

mech commented 9 years ago

I am using Mac OS X as server and not Linux. I am wondering if using Homebrew to install rbenv, will it be supported? I can't seems to get it done no matter what rbenv_custom_path I use

/usr/local/bin/rbenv
/Users/mech/.rbenv/shims/ruby
/Users/mech/.rbenv/versions/2.1.4/bin/ruby

If I set as this:

set :rbenv_ruby, '2.1.4'
set :rbenv_custom_path, '/Users/mech/.rbenv'

I am unable to make it work with these:

set :rbenv_custom_path, '/usr/local/Cellar/rbenv/0.4.0'
set :rbenv_path, '/usr/local/Cellar/rbenv/0.4.0' # Is there such a thing?

I always will encounter this:

bash: /Users/mech/.rbenv/bin/rbenv: No such file or directory

It is quite obvious that I do not have this path: ~/.rbenv/bin/

scmx commented 9 years ago

@mech Try this: ln -s /usr/local/Cellar/rbenv/0.4.0/bin ~/.rbenv/bin

(I used this for test deploying to a development osx machine https://github.com/standout/rails_db_dump_restore/blob/master/test/dummy/config/deploy.rb, so that I could make sure my cap db:pull task works. :)

dombarnes commented 8 years ago

I had to set set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} /usr/local/bin/rbenv exec" in my deploy.rb - this way its not tied to a version specific rbenv, if Homebrew updates it

jDeppen commented 7 years ago

@scmx said (thank you) .../0.4.0/... but my version is 1.1.1 Check your version with ls /usr/local/Cellar/rbenv/

This was the answer for me: ln -s /usr/local/Cellar/rbenv/1.1.1/bin ~/.rbenv/bin

I don't know if this is the best long-term solution (what happens when rbenv is updated?) but it works now. @dombarnes, that didn't work for me. I got bundle stderr: bash: /usr/local/bin/rbenv: No such file or directory even though /usr/local/bin/rbenv symlinks to ../Cellar/rbenv/1.1.1/bin/rbenv I'm using ZSH, maybe that's why? @mech, are you using ZSH?