-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Fixing NoMethodError when using system wide rvm and the gem_package resource. #66
Conversation
This was a problem for me as well. I first ran into this when I added include_recipe 'rvm::gem_package' Here is the error and backtrace:
I was also able to reproduce this problem with a simpler recipe, something like this: include_recipe 'rvm::system'
include_recipe 'rvm::gem_package'
gem_package 'facets' (the error and backtrace were identical) Simply changing gem_package 'facets' but that isn't an option in my original problem, since that relies on a 3rd-party recipe from the unicorn cookbook. So I really need the Here is the context of where it was failing: def install_via_gem_command(name, version)
...
cmd = %{rvm #{ruby_strings.join(',')} #{rvm_do(new_resource.user)} #{gem_binary_path}}
cmd << %{ install #{name} -q --no-rdoc --no-ri -v "#{version}"}
cmd << %{#{src}#{opts}}
if new_resource.respond_to?("user") && new_resource.user
...
else
...
end
...
end It tries to call In any case, why is it unconditionally calling |
Thanks, @kristopher, for the fix! Your patch fixed the problem for me. (I cherry-picked your commit into my fork of chef-rvm, applying it on top of the latest from upstream, bd3ff1f (Feb 23). Working great so far!) |
Excellent catch, thank you @kristopher for the fix and @TylerRick for confirming! Sorry about the huge delay in pulling this in. |
Fixing NoMethodError when using system wide rvm and the gem_package resource.
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. |
Today I updated the chef-rvm cookbook to head and started getting this error. It is repeatable for me in vagrant.
Error
Code that causes the error.