厨师 - 错误:RuntimeError:请设置编辑器环境变量 - 同时在厨师中创建角色

发布于 2025-01-27 07:00:18 字数 1186 浏览 3 评论 0原文

我是厨师的新手。今天,当我在厨师中的学习角色时,我创建了一个测试角色RB文件 -

name "reposerver"
description "repo server for sles12.4,12.5"
run_list "recipe[e]"

然后我运行刀具来创建此角色,但失败了 -

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.

搜索后,我找到了这一点 - 厨师 - 错误:runtimeerror:请设置编辑器环境变量

所以请按照它进行操作这个 -

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"

但是“刀具角色从文件角色\ reposerver.rb创建”仍然失败了,但我的config.rb中有任何错误?还是不应该在C中:\ Users \用户名\ .Chef? 感谢您的答复。

关于

艾森

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与君绝 2025-02-03 07:00:18

测试后,我发现了这个问题 -
这是由于Ultraedit而不是阻止文本编辑器,一旦打开文件,Ultraedit将不再容纳文件处理程序。因此,刀找不到是否更新。因此,一旦我将其更改为 -

刀[:editor] =“记事本”

问题。

After testing, I found the issue --
It's due to ultraedit is not a blocking text editor, once file is opened, ultraedit will not hold the file handler anymore. So knife can't find it updated or not. So once I changed it to --

knife[:editor] = "notepad"

Issue fixed.

┊风居住的梦幻卍 2025-02-03 07:00:18

设置一个名为编辑器指向Ultraedit可执行文件的Windows环境变量。应该解决它。

Set a windows environment variable called EDITOR pointing to the UltraEdit executable. That should fix it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文