I'm new to Chef. Today, while study role in chef, I created a test role rb file --
name "reposerver"
description "repo server for sles12.4,12.5"
run_list "recipe[e]"
Then I run knife command to create this role, but failed with --
C:\Work\chef-repo>knife role create from file roles\reposerver.rb
ERROR: RuntimeError: Please set EDITOR environment variable. See https://docs.chef.io/knife_setup/ for details.
After search, I found this -- Chef - ERROR: RuntimeError: Please set EDITOR environment variable
So follow it, I modify my config.rb like this --
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "eisenwang"
client_key "#{current_dir}/eisenwang.pem"
chef_server_url "https://api.chef.io/organizations/eisen"
cookbook_path ["#{current_dir}/../cookbooks"]
knife[:editor] = "C:\\Program Files (x86)\\IDM Computer Solutions\\UltraEdit\\Uedit32.exe"
But that "knife role create from file roles\reposerver.rb" still fails with same error... Is there any wrong in my config.rb? Or it should not be in C:\users\username\.chef ? Thanks for your reply.
Regards
Eisen