ruby - 在 `+' 中:没有将 nil 隐式转换为 String (TypeError)
问题描述
我正在安装 VVV 并在执行“vagrant up”命令时卡住了。它向我显示以下错误:
C:/Users/Admin/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:152:in `+': no implicit conversion of nil into String (TypeError)
当我打开 ruby 文件时,
elsif Vagrant::Util::Platform.windows?
require 'tmpdir'
uuid = @machine.id || @machine.config.hostsupdater.id
tmpPath = File.join(Dir.tmpdir, 'hosts-' + uuid + '.cmd')
File.open(tmpPath, "w") do |tmpFile|
entries.each { |line| tmpFile.puts(">>\"#{@@hosts_path}\" echo #{line}") }
end
sudo(tmpPath)
File.delete(tmpPath)
“tmpPath = File.join(Dir.tmpdir, 'hosts-' + uuid + '.cmd')” 是给我错误的行。
我正在尝试通过 Youtube 视频安装 VVV,按照视频中给出的确切步骤进行操作,那么该视频为什么没有遇到此错误,而我却遇到了。
解决方案
推荐阅读
- python - 在 vscode 中遇到回溯后如何获取完整的结果?
- computer-vision - 在分割图像的每个段上绘制边界框
- c - 我不断收到分段错误,但我找不到它!我想我把它缩小到一个特定的功能
- ios - 重新加载时,Swift TableView 内容消失并闪烁
- javascript - 如何在 JavaScript TypedArray 中存储和检索二进制矩阵?
- php - 带有小括号的精确单词的正则表达式在 PHP 中不起作用
- c++ - g ++没有链接wayland方法
- kotlin-exposed - 如何使用 Kotlin SQL Exposed 添加新列
- python - 总结熊猫中不同行值之间的绝对差异
- react-native - 使用 react-native 的动画 API 左对齐缩放的视图/文本