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

RVM string cache problem (in rvm_shell) #35

Closed
jonleighton opened this issue Aug 23, 2011 · 5 comments
Closed

RVM string cache problem (in rvm_shell) #35

jonleighton opened this issue Aug 23, 2011 · 5 comments
Assignees
Labels
Bug Something isn't working

Comments

@jonleighton
Copy link

I have RVM installed system-wide, and I am doing something like this in a recipe:

rvm_shell "bundle install" do
  user        'vagrant'
  group       'vagrant'
  ...
end

Due to the setting of the user, canonical_ruby_string in Chef::RVM::StringCache looks for the rvm source file in the "vagrant" user's home directory. However, RVM is installed system-wide, so this causes it to break.

Perhaps it should check the user's home dir, and then fall back to the system wide location.

@fnichol
Copy link
Contributor

fnichol commented Aug 23, 2011

Oh right, there are two notions of user in this resource:

  • A non-nil value denoting a per-user install
  • The user to run the script as

And in a lot of cases these two don't overlap.

If you wanted to run bundle install on a system-wide install with the vagrant and another bundle install on a user install for jenkins, which form do you think is clearer:

a)

rvm_shell "bundle install" do
  user "vagrant"
end

rvm_shell "bundle install" do
  rvm_user "jenkins"
end

b)

rvm_shell "bundle install" do
  shell_user "vagrant"
end

rvm_shell "bundle install" do
  user "jenkins"
end

c)
An alternative?

@ghost ghost assigned fnichol Aug 23, 2011
@fnichol
Copy link
Contributor

fnichol commented Aug 23, 2011

I found a way to keep the user attribute as is, but fall back to system wide if they don't have a user RVM installed (as you suggested). Push coming...

@fnichol
Copy link
Contributor

fnichol commented Aug 23, 2011

@jonleighton thanks for pointing out this issue. If I didn't quite solve your problem, please reopen.

@jonleighton
Copy link
Author

Thanks, I'll check this stuff out next week when I return to the project I am using chef-rvm on. Cheers!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants