0

Upgraded chefdk and i'm getting this error runing knife

bash: /usr/local/bin/knife: /usr/bin/ruby2.1: bad interpreter: No such file or directory

why is my /usr/local/bin/knife calling /usr/bin/ruby2.1

Anyway i changed the /usr/local/bin/knife file to point to my ruby file

$ which ruby
 /opt/chefdk/embedded/bin/ruby


 #!/opt/chefdk/embedded/bin/ruby
 #
 # This file was generated by RubyGems.
 ......... 
  • I don't know how you did install knife, but `/usr/local/bin` is not its place at all. Did you tweak your previous install ? To fix (workaround) this use `chef shell-init bash` at start of your session, this will set the PATH and some other variables to chef-dk ones and all should work smoothly. – Tensibai Nov 02 '16 at 09:03

1 Answers1

0

We recently switched Chef and ChefDK from Ruby 2.1 to 2.3. It sounds like when you installed the newer ChefDK it didn't correctly overwrite the previous symlinks or that the install was only partially completed.

coderanger
  • 52,400
  • 4
  • 52
  • 75