ERROR: RuntimeError: Please set EDITOR environment variable

Ohai chefs,

I’ve just setup a workstation on windows, and I’m getting the following
error when I try to edit a data bag;

$ knife data bag edit tomhodder tomhodder
ERROR: RuntimeError: Please set EDITOR environment variable

I’ve tried various combinations of vi, vim, /bin/vim and /bin/vi like so;

$ export EDITOR=/bin/vim

but its still rather stubbornly returning;

$ knife data bag edit tomhodder tomhodder
ERROR: RuntimeError: Please set EDITOR environment variable

Interestingly, I can’t get it to bite on any of the options versions of
providing the EDITOR, using “-e” or “–editor”;

$ knife data bag edit tomhodder tomhodder -e vim
ERROR: RuntimeError: Please set EDITOR environment variable

$ knife data bag edit tomhodder tomhodder --editor vim
ERROR: RuntimeError: Please set EDITOR environment variable

$ knife data bag edit tomhodder tomhodder --editor /bin/vim
ERROR: RuntimeError: Please set EDITOR environment variable

any suggestions?

I'd too faced this sometime ago.

Later it came out that the exit code from vim was non zero exit code which
caused this.
Digging deeper, don't know why my .vimrc was loaded with so many
things/plugins.
Can u just try with basic vimrc without any external plugins?
That was how I got rescued from this pretty annoying situation.

On Monday, May 20, 2013, Tom Hodder wrote:

Ohai chefs,

I've just setup a workstation on windows, and I'm getting the following
error when I try to edit a data bag;

$ knife data bag edit tomhodder tomhodder
ERROR: RuntimeError: Please set EDITOR environment variable

I've tried various combinations of vi, vim, /bin/vim and /bin/vi like so;

$ export EDITOR=/bin/vim

but its still rather stubbornly returning;

$ knife data bag edit tomhodder tomhodder
ERROR: RuntimeError: Please set EDITOR environment variable

Interestingly, I can't get it to bite on any of the options versions of
providing the EDITOR, using "-e" or "--editor";

$ knife data bag edit tomhodder tomhodder -e vim
ERROR: RuntimeError: Please set EDITOR environment variable

$ knife data bag edit tomhodder tomhodder --editor vim
ERROR: RuntimeError: Please set EDITOR environment variable

$ knife data bag edit tomhodder tomhodder --editor /bin/vim
ERROR: RuntimeError: Please set EDITOR environment variable

any suggestions?

--
Sent from Millisami'z iPad mini

Can u just try with basic vimrc without any external plugins?

I managed to track it down to this;