'initialize':不将String隐式转换为Integer(TypeError)

时间:2019-01-19 12:59:38

标签: ruby

错误是:

./batch_build.rb:83:in `initialize': no implicit conversion of String into Integer (TypeError)  
  from ./batch_build.rb:83:in `open'
  from ./batch_build.rb:83:in `<main>'

第83行提到:

IO.open("xcodebuild -scheme Runner archive -archivePath '/tmp/#{BUILD_DIR}' -UseNewBuildSystem=NO -allowProvisioningUpdates") do |line|

    hasError = true if line.downcase.include? 'error' # line 85

    `xcode /tmp/#{BUILD_DIR}/Runner.xarchive` # line 87

end # line 89

相关行是:

KEY_FILE = 'android/key.properties'
verCode = `cat #{KEY_FILE} | grep versionCode | cut -d '=' -f 2`.to_i
verCode += 1
BUILD_DIR = "xyz_#{verCode}"

怎么了?

1 个答案:

答案 0 :(得分:1)

该死,它应该是popen而不是open, 在第83行的.each之前也缺少do

嗯..我应该删除这个问题吗?