ddollar / foreman

Manage Procfile-based applications

Home Page:http://ddollar.github.com/foreman

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.19.3 did not resolve this issue: "run" is a Thor reserved word and cannot be defined as command (RuntimeError)

ThomasConnolly opened this issue · comments

same issue

foreman start
/ruby-2.3.3/gems/thor-0.19.3/lib/thor/base.rb:534:in `thor_reserved_word?': "run" is a Thor reserved word and cannot be defined as command (RuntimeError)
	from /ruby-2.3.3/gems/thor-0.19.3/lib/thor/base.rb:597:in `method_added'
	from /ruby-2.3.3/gems/foreman-0.82.0/lib/foreman/cli.rb:80:in `<class:CLI>'
	from /ruby-2.3.3/gems/foreman-0.82.0/lib/foreman/cli.rb:11:in `<top (required)>'
	from /ruby-2.3.3/gems/foreman-0.82.0/bin/foreman:5:in `require'
	from /ruby-2.3.3/gems/foreman-0.82.0/bin/foreman:5:in `<top (required)>'
	from /ruby-2.3.3/bin/foreman:22:in `load'
	from /ruby-2.3.3/bin/foreman:22:in `<main>'
	from /ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'
	from /ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>'

Root cause is that thor 0.19.2 changed it's protected method name in this commit.

  • Before:
    • Thor::Base.is_thor_reserved_word?
  • After:
    • Thor::Base.thor_reserved_word?

foreman has override that method in cli.rb, and it's not compatible to thor 0.19.2.

    # Hackery. Take the run method away from Thor so that we can redefine it.
    def is_thor_reserved_word?(word, type)
      return false if word == "run"
      super
    end

I did not intend to make a breaking change by renaming is_thor_reserved_word?.

I will change it back and release 0.19.4.

This is resolved in rails/thor@329cff6 and the 0.19.4 release. Please close this issue.

Thanks!