Open salex opened 10 years ago
If you use Homebrew, your rbenv_ruby
path should be /usr/local/Cellar/rbenv/0.4.0
That means you don't need to change rbenv_prefix
at all.
Thank you. Knew it had to be simpler. Again, new to rbenv and did the Capistrano using the recipes screencasts, not really understanding Capistrano -- I'll work on that.
@salex, did you manage to get it working?
Is it as such:
set :rbenv_ruby, '/usr/local/Cellar/rbenv/0.4.0'
Don't think that is working on my side. Also do we need the .ruby-version
file?
@mech rbenv_ruby
should point to ruby version, not the directory with rbenv
If I put the config as such
set :rbenv_type, :user
set :rbenv_ruby, '2.1.4'
I will get this error
bash: /Users/mech/.rbenv/bin/rbenv: No such file or directory
That's why it is puzzling how come it need to find such directory on a Mac OS X setup. I feel that it is like only for Linux. Obviously in a Mac using a typical install of rbenv with Homebrew, there is no such directory :(
Based on the settings listed in the Usage section of capistrano/rbenv, the following worked by changing the path to the actual rbenv executable (/usr/local/bin/rbenv
).
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} /usr/local/bin/rbenv exec"
I had to set :rbenv_path, '/usr/local/opt/rbenv'
in addition to @shawnpyle's solution to get rbenv to find the bundler executable.
@kirs, did you mean that this is already the default for rbenv_ruby and there's nothing to set?
If you use Homebrew, your rbenv_ruby path should be /usr/local/Cellar/rbenv/0.4.0
I'm wondering because you also said:
@mech rbenv_ruby should point to ruby version, not the directory with rbenv
Does this mean 'don't even set (rather than change) rbenv_prefix at all':
That means you don't need to change rbenv_prefix at all.
To avoid
/Users/jason/.rbenv/bin/rbenv: No such file or directory
, I had to:ln -s /usr/local/Cellar/rbenv/1.1.1/bin ~/.rbenv/bin
Of course, this will break when rbenv is updated.
What's the proper way to set this up when installing with Homebrew? Thank you!
related: #52
In my case I installed the Ubuntu rbenv
package. This seems to place the binary elsewhere (outside of the .rbenv
path). To fix this you need to configure it explicitly:
set :rbenv_prefix, '/usr/bin/rbenv exec'
Use which rbenv
on your server to find the correct location.
You can see the logic around this here::
I have a server (OS X server) running several small rails applications. I had initially set it using brew to install ruby (could not get rvm to install!). I made some changes to one of the apps and ran into all kinds of problems with I updated the brew ruby version. I decided to try rbenv and set it up on the server. Lots of problems with clashes with the brew version that I eventually figured out.
I then tried to deploy and discovered that my bundle update loaded capistrano 3.1 and nothing worked. I started the conversion processes and I got stuck on:
I have no bin directory on what brew installed for rbenv. I changed it to:
and got it to work, but maybe I'm missing something. I did get a basic deploy to work, but still have to get the rest of my 'railscast/recipes' to work, like writing plists for launchd etc.