Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install gems when rbenv is installed system wide #16

Open
khelben opened this issue Nov 10, 2014 · 7 comments
Open

install gems when rbenv is installed system wide #16

khelben opened this issue Nov 10, 2014 · 7 comments

Comments

@khelben
Copy link

khelben commented Nov 10, 2014

When I deploy rbenv to be installed system-wide, I cannot install any gems on the installed host.

Do I need to install the gems with sudo gem install ...?

@zzet
Copy link
Owner

zzet commented Nov 11, 2014

Hi @khelben. Yes.

It's normal trouble: rbenv/rbenv#38 && http://stackoverflow.com/a/18555295

@vchervanev
Copy link

@zzet, there is an interesting problem (ubuntu 14.04.1) - when Ansible(1.8.2) runs a SUDO command scripts at profile.d are ignored. As a result env is not prepared and system version of gem is run.

@blackjid
Copy link

@vchervanev did you find the solution to this?

@vchervanev
Copy link

@blackjid I'd say Yes. In my case the right way is to use a 3rd party package (e.g. bright-box) since it isn't a dev machine and there is no need to switch between versions. However, if you need RBENV installed - there is a workaround. My initial conclusion was wrong - SUDO is not the reason, but a non-login shell session is.

I moved rbenv's init code to ~/.bashrc and it helped.

@zzet
Copy link
Owner

zzet commented Mar 11, 2015

@vchervanev

I moved rbenv's init code to ~/.bashrc and it helped.

Like as per user installation? :)

@vchervanev
Copy link

@zzet exactly! 8-)

Updated: I had to source env vars at the beginning of .bashrc, I'm not sure if it equals to "per user installation"

@todd-a-jacobs
Copy link

When doing a system install, the module really ought to be doing the following:

  1. ensuring the existence of rbenv group using

  2. setting /usr/local/rbenv to be owned by the rbenv_group user

  3. ensuring directories and files have the proper group ownership, e.g.:

    sudo find /usr/local/rbenv -type d -exec chmod g+ws {} +
    sudo find /usr/local/rbenv -type f -exec chmod g+w {} +
    
  4. ensure that the user has the rbenv_group appended to that user's groups list

If you do those things, either within your Ansible scripts or by hand, it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants