itamaeを実行するとエラー

症状

インストールしたitamaeが以下のようなエラーで実行できない。

[vagrant@localhost ~]$ itamae -h
Traceback (most recent call last):
        10: from /opt/rbenv/versions/2.6.6/bin/itamae:23:in `<main>'
         9: from /opt/rbenv/versions/2.6.6/bin/itamae:23:in `load'
         8: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/itamae-1.11.1/bin/itamae:4:in `<top (required)>'
         7: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
         6: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
         5: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
         4: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
         3: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor.rb:513:in `help'
         2: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor.rb:205:in `help'
         1: from /opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor/shell/basic.rb:97:in `say'
/opt/rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.1.0/lib/thor/shell/basic.rb:393:in `quiet?': private method `options' called for #<Itamae::CLI:0x000000000279d090> (NoMethodError)
Did you mean?  options=

対応

thorのバージョンを1.1.0→1.0.1に下げる。

[vagrant@localhost ~]$ gem install thor --version="1.0.1" 
Fetching thor-1.0.1.gem
Successfully installed thor-1.0.1
Parsing documentation for thor-1.0.1
Installing ri documentation for thor-1.0.1
Done installing documentation for thor after 1 seconds
1 gem installed
[vagrant@localhost ~]$ gem uninstall thor --version="1.1.0" 
Successfully uninstalled thor-1.1.0
[vagrant@localhost ~]$ thor -v
Thor 1.0.1

確認

[vagrant@localhost ~]$ itamae -h
Commands:
  itamae destroy [cookbook|role] [NAME]   # Undo role or cookbook (short-cut alias: "d")
  itamae docker RECIPE [RECIPE...]        # Create Docker image
  itamae generate [cookbook|role] [NAME]  # Initialize role or cookbook (short-cut alias: "g")
  itamae help [COMMAND]                   # Describe available commands or one specific command
  itamae init NAME                        # Create a new project
  itamae jail RECIPE [RECIPE...]          # Run Itamae in jail
  itamae local RECIPE [RECIPE...]         # Run Itamae locally
  itamae ssh RECIPE [RECIPE...]           # Run Itamae via ssh
  itamae version                          # Print version

この症状に遭遇したのは2021/01/28。
thorの更新日を見てると最近更新の1.1.0が2021/1/20、前回が2019年12月17日。
ネットに情報が無いのはまだ日が経っていないためと思われる。 rubygems.org

参考

kawakubox.hatenablog.com