我正在尝试从 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'
我遵循了每一步,但我不确定我做错了什么。有人有提示吗?
提前致谢
错误:nil:NilClass 的未定义方法 `sub' 查看您的异常情况,您似乎没有设置重定向 URI,因此出现了错误消息。下面您可以找到 DocuSign SDK 库中的方法说明:
# 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://docusign.github.io/docusign-esign-ruby-client/DocuSign_eSign/Configuration.html#method-i-host-3D