Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chef: How to set EDITOR for knife

Tags:

When I run below command I get the error mentioned below:

$ knife node edit hostname.domain.com ERROR: You must set your EDITOR environment variable or configure your editor via knife.rb 

I wanted to set editor value in the knife.rb but I am not able to find which option would correspond to the editor. I have gone through below links which explain various options supported by knife.rb:

http://docs.opscode.com/config_rb_knife.html

http://docs.opscode.com/config_rb_knife_optional_settings.html

I know I did not overlook above links but i can;'t find an option which is relevant to setting editor value.

Could you point me to the correct options whihc will help me set editor for knife.

Thanks.

like image 430
slayedbylucifer Avatar asked Jul 10 '13 05:07

slayedbylucifer


1 Answers

You can set the EDITOR variable in two ways. First way is to SET EDITOR variable in command line.

export "EDITOR=nano" 

OR

export "EDITOR=vim" 

Second Way is set EDITOR in knife.rb file.

knife[:editor]="vim" 

OR

knife[:editor]="nano" 

nano is also a editor shipped with Ubuntu.

like image 153
Rajesh Hegde Avatar answered Sep 24 '22 23:09

Rajesh Hegde