Chef - ERROR: RuntimeError: Please set EDITOR environment variable

GigaPr picture GigaPr · Mar 22, 2013 · Viewed 43.8k times · Source

I've installed successfully chef on my workstation but when i am trying to create a role using the following command

knife role create startmeup

I get

ERROR: RuntimeError: Please set EDITOR environment variable

Any idea what the problem is?

Answer

StephenKing picture StephenKing · Mar 22, 2013

You have to define EDITOR as environment variable.

Try

export EDITOR=$(which vi)

To persist this, add it to ~/.bashrc or ~/.bash_profile.