Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

knife cook should (?) force omnibus ruby if available #140

Closed
aaronjensen opened this issue Dec 5, 2012 · 10 comments
Closed

knife cook should (?) force omnibus ruby if available #140

aaronjensen opened this issue Dec 5, 2012 · 10 comments

Comments

@aaronjensen
Copy link
Contributor

Right now if sudo has acces to rvm it will use the rvm default ruby rather than the omnibus ruby. Any ideas how to work aroudn this?

@matschaffer
Copy link
Owner

That could be tricky since rvm also mucks with the path. Perhaps we could manipulate the path on a which call to get the full path to omnibus then call that directly?

@matschaffer
Copy link
Owner

If you have a set of recipes or AMI that reproduce the situation, definitely post it btw. I don't typically use rvm in production.

@hrp
Copy link
Contributor

hrp commented Jan 5, 2013

This issue on the chef-rvm repo may help: sous-chefs/rvm#125.

@matschaffer
Copy link
Owner

Thinking about this a bit more. If you run 'which chef-solo' what do you get? Do you have a copy of the chef gem under rvm as well? I would expect that the omnibus copy of chef-solo has a hardcoded path to the embedded ruby.

@hrp
Copy link
Contributor

hrp commented Jan 7, 2013

which chef-solo => /usr/bin/chef-solo

If I cook a second time I get this error:

/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find chef (>= 0) amongst [bundler-1.2.3, rake-10.0.3, rubygems-bundler-1.1.0, rvm-1.11.3.5] (Gem::LoadError)
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /usr/bin/chef-solo:22:in `<main>'

@fnichol
Copy link
Contributor

fnichol commented Jan 15, 2013

Hey all, I've merged sous-chefs/rvm#125 into master.

@hrp It looks to me like RVM might be loaded (login shell perhaps?) and it's trying to use your default RVM Ruby's RubyGems. When I get this logged into a box I can usually clear it with an rvm system (it'll unset some of the RUBY_* and GEM_* envvars).

@matschaffer
Copy link
Owner

@hrp if @fnichol's recommendation works should we close this issue?

@hrp
Copy link
Contributor

hrp commented Jan 15, 2013

@matschaffer Sure, go ahead and close this. I haven't seen this problem lately (I've been using a fork of chef-rvm with the above commit included) so it may be solved. If I notice it again, I'll try @fnichol's solution. If that doesn't work out, I can reopen or make a new issue.

@matschaffer
Copy link
Owner

Thanks @hrp!

@PeterBell
Copy link

FWIW I had the same issue and "rvm system" resolved it for me.

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

No branches or pull requests

5 participants