LoginSignup
1
1

More than 5 years have passed since last update.

Windows 7 で chefdk を使う準備

Posted at

Windows 7 64 bit で kitchen test を実行するまでのメモ。

  • https://downloads.chef.io/chef-dk/windows/ からインストーラをダウンロード。
  • インストーラを実行。 選択肢は全てデフォルト値。
  • Chef Development Kit を実行。-> power shell でエラー。 スクリプトの実行ポリシーの制約を緩和する。
Import-Module : スクリプトの実行がシステムで無効になっているため、ファイル C:\opscode\chefdk\modules\chef\chef.psm1 を読み込めません。詳細については、「get-help about_signing」と入力してヘルプを参照してください。
発生場所 行:1 文字:136
+ $env:PATH = 'C:\opscode\chefdk\bin;' + $env:PATH; $env:CHEFDK_ENV_FIX = 1; chef shell-init powershell | out-string | iex; Import-Module <<<<  chef -DisableNameChecking;echo 'PowerShell 2.0 (Microsoft Windows NT 6.1.7601 Service Pack 1)';write-host -foregroundcolor darkyellow 'Ohai, welcome to ChefDK!
    + CategoryInfo          : NotSpecified: (:) [Import-Module]、PSSecurityException
    + FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.ImportModuleCommand

> get-executionpolicy
Restricted
> set-executionpolicy remotesigned

これで chef が使えるようになる。

ついでに,knife-zero をインストール。

> gem install --no-document

パスが通っていないとの warning が出力されたため,対処する。永続的にパスを通すため,

> $Profile

として表示されるファイルを作成し,そのファイルに以下を記載。

$Env:Path = "path\to\local\chefdk\gem\ruby\2.1.0\bin;" + $Env:Path

(path\to\ の部分は,gem install 実行時の warning で出力されるパス)

以上。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1