ruby - 'TypeError:没有将 nil 隐式转换为 String' 错误
问题描述
以下代码(TypeError: no implicit conversion of nil into String)
在最后一行返回错误:
And(/^the user makes the following changes in the response file "(.*)" and creates a uri with "(.*)" and wskey:$/) do |readFile, strURI,table|
strRequestBody = $objFileIO.ReadFile(STR_FILE_SPEC + '/response/' + readFile)
table.hashes.each do |rows|
@request_uri = strRequestBody.gsub!(/#{rows[:parameter_in_response]}/, rows[:replace_with])
end
puts "this is url" + @request_uri
end
解决方案
只需在循环之外定义它,然后勺子就会改变。
推荐阅读
- augmented-reality - USDZ 水平面位置错误
- python - installing pyinstaller on python 3.4.3
- css - 复选框显示两个
- c# - 如果行在另一个表中被引用,aspnetzero 会阻止软删除
- heroku - 在 Heroku 上播放 2.8.8 部署在启动服务器时崩溃
- azure - Azure 应用服务(Flask 应用程序)性能不佳
- php - Laravel 关系中的条件
- splunk - Splunk 仪表板和报告源备份以进行版本控制
- node.js - 使用 Heroku Node.js 构建失败,用于 MEAN 堆栈应用程序-heroku 日志中的 h18 错误
- javascript - $(window).scrollTop() 应该是 0,但不是