Skip to content

Export RBENV_ROOT before rbenv init for system-wide install #106

@jgarber

Description

@jgarber

I was having problems using rbenv with mina when it was installed system-wide (with fnichol's rbenv::system recipe).

I have set :rbenv_path, '/usr/local/rbenv' set in deploy.rb and an queue echo_cmd %{echo $PATH} before invoke :'bundle:install'.

       $ echo $PATH
       /home/vagrant/.rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
-----> Installing gem dependencies using Bundler
       $ mkdir -p "/srv/myapp/shared/bundle"
       $ mkdir -p "./vendor"
       $ ln -s "/srv/myapp/shared/bundle" "./vendor/bundle"
       $ bundle install --without development:test --path "./vendor/bundle" --binstubs bin/ --deployment
       bash: line 118: bundle: command not found
 !     ERROR: Deploy failed.

To get rbenv to work, I set queue %{export RBENV_ROOT=#{rbenv_path}} before invoke :'rbenv:load'. Then I get:

       $ echo $PATH
       /usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
-----> Installing gem dependencies using Bundler
       $ mkdir -p "/srv/myapp/shared/bundle"
       $ mkdir -p "./vendor"
       $ ln -s "/srv/myapp/shared/bundle" "./vendor/bundle"
       $ bundle install --without development:test --path "./vendor/bundle" --binstubs bin/ --deployment
       Using rake (10.0.3) 
       ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions