Hey guys, i have been wondering if we should not be using rvm or any other
versions of ruby with chef. I have rvm installed in my chef devel
workstation (ubuntu 12.04). I have repos/workspace where i create custom
mulitple cookbooks (some uses the community cookbooks) specific to
projects. Each workspace have the ‘.ruby-version’ and ‘.ruby-gemset’ files.
Based on the chef doc to install chefDK
https://docs.chef.io/install_dk.html, it says to use the chef ruby as the
system ruby by using this command.
echo ‘eval “$(chef shell-init bash)”’ >> ~/.bash_profile
The above command doesn’t like to be in the ~/.bash_profile so, i
placed it in ~/.bashrc file and works.
Now, i had a similar issue after installing the rvm (system-wide).
Ubuntu wont source the /etc/profile.d/rvm.sh
http://askubuntu.com/questions/40287/etc-profile-not-being-sourced.
So, i had to place the
below entry in the ~/.bashrc file again. So the new entries in the
~/.bashrc files are:
####Added by me
[[ -s “/etc/profile.d/rvm.sh” ]] && . “/etc/profile.d/rvm.sh” # Load
RVM function
####added by me
eval “$(chef shell-init bash)” #loads chefdk ruby
With these entries now, whenever a new shell is started i am greeted
by the below warning:
Warning! PATH is not properly set up,
’/home/user/.chefdk/gem/ruby/2.1.0/bin’ is not at first place,
usually this is caused by shell initialization files - check
them for ‘PATH=…’ entries,
it might also help to re-add RVM to your dotfiles: ‘rvm get
stable --auto-dotfiles’,
to fix temporarily in this shell session run: ‘rvm use 2.1.0’.