やりたいこと
Herokuでデプロイしたアプリを独自ドメインに紐付けたいです。
環境
Ruby(rbenv) 2.6.0
Rails 5.2.2
Heroku hobby plan
thor (エラー原因?) 0.20.3
現状
このQiita記事
を参考にして、ドメインを入力するとHerokuのApplication Errorが出る状態になっています。
エラー
heroku logs --tail
で、ログを確認してみました。
下記は、そのログのエラーの一部分です。
2019-05-15T03:37:20.815838+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p $POST -e production` 2019-05-15T03:37:23.662231+00:00 heroku[web.1]: State changed from starting to crashed 2019-05-15T03:37:23.649034+00:00 heroku[web.1]: Process exited with status 1 2019-05-15T03:37:23.607007+00:00 app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/parser/options.rb:218:in `parse_peek': No value provided for option '--port' (Thor::MalformattedArgumentError) 2019-05-15T03:37:23.607028+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/parser/options.rb:100:in `parse' 2019-05-15T03:37:23.607030+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:70:in `initialize' 2019-05-15T03:37:23.607031+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:25:in `initialize' 2019-05-15T03:37:23.607032+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/shell.rb:45:in `initialize' 2019-05-15T03:37:23.607039+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:134:in `initialize' 2019-05-15T03:37:23.607043+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:383:in `new' 2019-05-15T03:37:23.607044+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:383:in `dispatch' 2019-05-15T03:37:23.607049+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform' 2019-05-15T03:37:23.607050+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke' 2019-05-15T03:37:23.607051+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>' 2019-05-15T03:37:23.607052+00:00 app[web.1]: from bin/rails:9:in `require' 2019-05-15T03:37:23.607054+00:00 app[web.1]: from bin/rails:9:in `<main>'
考えられる原因
thorというgemがのparse_peekというメソッドの引数がおかしいらしいです。
このthorはGemfileからインストールしたものではなく、ディレクトリ上で gem install thorをして入れたものです。(初期状態から入っていました)
/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/parser/options/rb
のparse_peekメソッドはこのようなものです。
ruby
1def parse_peek(switch, option) 2 if parsing_options? && (current_is_switch_formatted? || last?) 3 if option.boolean? 4 # No problem for boolean types 5 elsif no_or_skip?(switch) 6 return nil # User set value to nil 7 elsif option.string? && !option.required? 8 # Return the default if there is one, else the human name 9 return option.lazy_default || option.default || option.human_name 10 elsif option.lazy_default 11 return option.lazy_default 12 else 13 raise MalformattedArgumentError, "No value provided for option '#{switch}'" 14 end 15 end 16 17 @non_assigned_required.delete(option) 18 send(:"parse_#{option.type}", switch) 19 end
やったこと
gem install thor -v '0.20.0'のように他バージョンをインストールしたり、アンインストールなど試行錯誤のうちに少し汚してしまったかもしれません。
thorのバージョンは0.20.3が入っています。
どのように解決すればよいでしょうか。
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/17 07:14