[VCCW] Wordmove を実行したら undefined method `[]’ for nil:NilClass (NoMethodError) が発生する場合の対処
以前に作成していた VCCW 環境上に Wordmove の設定を加えて利用しようとしたところ、NoMethodError が発生。
[markdown]
“`prettyprinted
vccw v3.16.1
wordmove v2.4.0
“`
## 状況
VCCW 環境へログイン。
以下の実行時に `NoMethodError` が発生する。
“`prettyprinted
% vagrant ssh
$ cd /vagrant
$ wordmove pull -p
“`
## 原因
Movefile のフォーマットが変わったそうです。
> * [undefined method `[]’ for nil:NilClass (NoMethodError) · Issue #401 · welaika/wordmove](https://github.com/welaika/wordmove/issues/401)
## 対処
Movefile のひな型を生成。`movefile.yml` が生成されます。
既存の `Movefile` にペーストし、内容を適切なものに書き換えます。
“`prettyprinted
% wordmove init
“`
インデントを間違えやすいので、`wordmove doctor` か `yamllint` をすると良さそうです。
> * [yaml-lint – npm](https://www.npmjs.com/package/yaml-lint)
> * [adrienverge/yamllint: A linter for YAML files.](https://github.com/adrienverge/yamllint)
利用前に Wordmove と WP-CLI のバージョンを上げておきました。
“`prettyprinted
$ gem update wordmove
$ wordmove -v
3.1.2
$ sudo wp cli update
$ wp –version
WP-CLI 2.0.0-alpha-25fafc7
“`
[/markdown]