Techioz Blog

Docusign クイックスタート - 初回起動時の NoMethodError

概要

DocuSign ドキュメントから Ruby クイックスタート プロジェクトをセットアップして起動しようとしています: https://developers.docusign.com/docs/esign-rest-api/how-to/code-launchers/

フォームに記入し、コードを含む zip をダウンロードして、セットアップ全体を問題なく実行しました。

しかし、サーバーを起動して http://localhost:3000/ にアクセスしようとすると、エラーが表示されます。

NoMethodError in DsCommonController#index
undefined method `sub' for nil:NilClass

Extracted source (around line #40):              
  def worker
39    configuration = DocuSign_eSign::Configuration.new
40    configuration.host = args[:base_path] <<<< error on this line
41
42  @api_client = DocuSign_eSign::ApiClient.new(configuration)
43  @api_client.set_base_path(args[:base_path])

Rails.root: /Users/*******/Quickstart App-1-ruby

そしてターミナルで:

NoMethodError (undefined method `sub' for nil:NilClass

      @host = host.sub(/https?:\/\//, '').split('/').first
                  ^^^^):
  
app/services/e_sign/get_data_service.rb:40:in `worker'
app/services/e_sign/get_data_service.rb:30:in `cfr?'
app/controllers/ds_common_controller.rb:21:in `handle_redirects'
app/controllers/ds_common_controller.rb:9:in `index'

すべての手順を実行しましたが、何が間違っているのかわかりません。誰かがヒントを持っていますか?

前もって感謝します

解決策

前もって感謝します

# File lib/docusign_esign/configuration.rb, line 159
def host=(host)
  # remove http(s):// and anything after a slash
  @host = host.sub(/https?:\/\//, '').split('/').first
end

詳細については、SDK ライブラリで確認できます。 https://translate.google.com/translate?hl=ja&sl=en&tl=ja&u=https://docusign.github.io/docusign-esign-ruby-client/DocuSign_eSign/Configuration.html#method-i-host-3D