RiotGamesCookbooks / rbenv-cookbook

Installs and configures rbenv
http://community.opscode.com/cookbooks/rbenv
Apache License 2.0
137 stars 111 forks source link

Rbenv only installed for vagrant user #84

Open lserman opened 10 years ago

lserman commented 10 years ago

Hello,

My cookbook creates an apps user that I want to use for Rails deployment. I'm testing my recipe with Vagrant using this JSON:

chef.json = {
  app: {
    name: "test",
    rubies: ['2.0.0-p353']
  },
  rbenv: {
    user: "apps",
    group: "rbenv"
  }
}

I want to use the apps user for Rails deployment on my server. When I start vagrant though, only the vagrant user has access to rbenv. The apps user exists but receives

The program 'rbenv' is currently not installed.  You can install it by typing:
sudo apt-get install rbenv

It looks like rbenv is not being added to the $PATH like it is for the default vagrant user. How do I install rbenv for my apps user? I'd prefer not to have to edit $PATH myself. Here is the rbenv portion of my recipe (apps is created before this point):

# Rbenv
include_recipe 'rbenv::default'
include_recipe 'rbenv::ruby_build'

node.app.rubies.each do |rb|
  rbenv_ruby(rb)
  rbenv_gem('bundler') { ruby_version rb }
end
leonelgalan commented 10 years ago

I'm wondering the same thing, I also tried to set the ruby version to be global rbenv_ruby(rb) { global true }, but this is on a per user basis and only vagrant is getting it.

valachi commented 9 years ago

haven't tried it myself, but i guess that you should add rbenv users to the rbenv group or make a ruby installation global