[chef] Problems between Chef Ruby and system Ruby


Chronological Thread 
  • From: Robert Freiberger < >
  • To:
  • Subject: [chef] Problems between Chef Ruby and system Ruby
  • Date: Wed, 24 Dec 2014 00:09:41 +0000

Hello, 

I'm very new to Chef and going over the tutorials plus the Learning Chef book by O'Reilly. Everything is going very smooth but I'm having issues keeping the system Ruby and Chef Ruby working separate from each other. 

One of the issues I found is working with test kitchen. 

$ /opt/chefdk/bin/kitchen list
!!!!!! The `berkshelf' gem is missing and must be installed or cannot be properly activated. Run `gem install berkshelf` or add the following to your Gemfile if you are using Bundler: `gem 'berkshelf'`.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Could not load or activate Berkshelf (can't activate json-1.7.7, already activated json-1.8.1)
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I checked and found that the issue appears to be the system Gem is referencing a different version from the Chef Gem. 

$ gem list | grep json
json (1.7.7)

$ /opt/chefdk/embedded/bin/gem list | grep json
fog-json (1.0.0)
json (1.8.1, 1.7.7)
multi_json (1.10.1)

I know that many people are using RVM, but I had troubles making this work and would like to know what is best practice (from a newbie point of view). 

Thanks so much!
Robert




Archive powered by MHonArc 2.6.16.

§