You are not logged in.
Pages: 1
Hi
i am trying to install gems for chefdk and i get an error (for example knife-azure gem)
You don't have /root/.chefdk/gem/ruby/2.3.0/bin in your PATH,
gem executables will not run.
Successfully installed knife-azure-1.6.0
i used sudo to install the gem but it then goes as the output indicated to check a path in root user
how should i edit the ~/.bashrc file to make it work?
Thanks
Offline
Edit: Disregard what I wrote here and do what cirrus told below.
I have never used Ruby or installed gems, but I don't think you should install them with sudo.
As the error indicates the gems are installed in the root users home directory.
As to what you should do; stop installing gems with sudo and put something like this in ~/.bashrc or ~/.bash_profile:
export PATH="${PATH}:/home/username/.chefdk/gem/ruby/2.3.0/bin"
Last edited by jaergenoth (2016-10-15 17:42:15)
Offline
Put these in your ~/.gemrc to ensure all gems will be installed as user
gem: --user-install
gem: --no-ri --no-rdoc --no-document --suggestions
gempath: /home/$USER/.gem/ruby/2.3.0/bin
or install gems with ..
gem install --user-install <rubygem name>
otherwise you will need elevated priviledges to install and run rubygems, as you discovered. Installing systemwide is generally not required.
Last edited by cirrus (2016-10-15 17:00:46)
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline
Hi
thanks for your help and sorry for the late response
your suggestion did not helped eventually...
i managed to fix the issue after updating chefdk to the latest version
Offline
Pages: 1