无法加载此类文件 - mygem1

问题描述 投票:1回答:1

当我尝试使用chef-client运行食谱时,我创建了mygem:

 chef-client -zr recipe[Migration::2]

这是投掷错误:

 LoadError
    ---------
    cannot load such file -- mygem

    Running handlers:
    [2018-01-02T11:57:40+05:30] ERROR: Running exception handlers
    Running handlers complete
    [2018-01-02T11:57:40+05:30] ERROR: Exception handlers complete
    Chef Client failed. 0 resources updated in 15 seconds
    [2018-01-02T11:57:40+05:30] FATAL: Stacktrace dumped to c:/workstation-repo/.che
    f/local-mode-cache/cache/chef-stacktrace.out
    [2018-01-02T11:57:40+05:30] FATAL: Please provide the contents of the stacktrace
    .out file if you file a bug report
    [2018-01-02T11:57:40+05:30] FATAL: LoadError: cannot load such file -- mygem1
chef chef-recipe
1个回答
0
投票

Chef在运行时使用自己的Ruby环境,与系统Ruby环境分开。宝石可以通过chef_gem资源安装。不建议新用户使用,因为编写脆弱的代码非常容易。如果您的目标是运行数据库迁移或类似操作,则可能需要运行命令execute'/usr/bin/ruby /path/to/migrate.rb'资源。

© www.soinside.com 2019 - 2024. All rights reserved.