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_gem resource fails to load RVM environment on initial pass #15

Closed
fnichol opened this issue May 1, 2011 · 4 comments
Closed

rvm_gem resource fails to load RVM environment on initial pass #15

fnichol opened this issue May 1, 2011 · 4 comments
Assignees
Labels
Bug Something isn't working

Comments

@fnichol
Copy link
Contributor

fnichol commented May 1, 2011

This is summarized by @yfeldblum in a comment for #14. The change was added to close #10 but clearly is not totally correct yet.

A copy of the comment text is included:


Additionally, once I do the above and have RVM installed and RVM rubies installed but no default RVM ruby (instead continuing to use system ruby as the default)....

When I follow up and do

rvm_gem "whatever" do
  ruby_string "ruby-1.9.2-p180" # that's one of the already-installed RVM rubies
end

then, in the same initial run of the my cookbook (which makes use of your RVM cookbook), I get

ERROR: rvm_gem[whatever] (/srv/chef/cache/cookbooks/myfuncookbook/recipes/myfunrecipe.rb:1:in `from_file') had an error:
Expected process to exit 0, but it exited with 127
---- Begin output of bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath ----
STDOUT: 
STDERR: sh: rvm: not found
---- End output of bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath ----
Ran bash -c "source /etc/profile.d/rvm.sh" && rvm ruby-1.9.2-p180 gem env gempath returned 127
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/shell_out.rb:232:in `invalid!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/shell_out.rb:218:in `error!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/shell_out.rb:33:in `shell_out!'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:237:in `gem_paths'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:245:in `gem_source_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:76:in `installed_versions'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:346:in `matching_installed_versions'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:329:in `current_version'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/package/rubygems.rb:362:in `load_current_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:394:in `run_action'
/srv/chef/cache/cookbooks/rvm/providers/gem.rb:109:in `gem_package_wrapper'
/srv/chef/cache/cookbooks/rvm/providers/gem.rb:40:in `class_from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `action_install'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:53:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:89:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection.rb:94
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/runner.rb:84:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:268:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/client.rb:171:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:222:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:212:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application/client.rb:212:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/application.rb:62:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19

But on the second attempt to run the cookbook, the "rvm_gem[whatever]" resource succeeds (instead of failing with the above backtrace) as expected.

@ghost ghost assigned fnichol May 1, 2011
@fnichol
Copy link
Contributor Author

fnichol commented May 2, 2011

I'm suspecting there is a regression or breaking change in the RVM codebase post v1.6.5 that is contributing here. When I lock the RVM version to the 1.6.5 release (most current at this date):

{ "rvm": { "version": "1.6.5" } }

the error is not tripped. Will have to follow up in #rvm (freenode) or keep digging elsewhere.

@BugRoger
Copy link

I ran into the same issue using rvm 1.6.10. Additionally a second chef-client will not fix it. After logout and login it works again though.

I suppose RVM is not properly sourced into the currently running shell.

@fnichol
Copy link
Contributor Author

fnichol commented Jun 19, 2011

Anyone still have issues with this one? RVM 1.6.20 seems much better behaved and the rvm_gem provider has been totally rewritten since this bug was filed. I'll be aggressive and close it but by all means re-open if I'm incorrect.

@fnichol fnichol closed this as completed Jun 19, 2011
@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