{"record":{"id":"772c7fa249bc1231","repo":"jdx/mise","slug":"cannot-install-src-does-not-exist","errorCode":null,"errorMessage":"cannot install #{src}: does not exist","messagePattern":"cannot install #(.+?): does not exist","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/shim.rb","lineNumber":239,"sourceCode":"end\n\n# Pathname extensions mirroring brew's\nclass Pathname\n  def install(*sources)\n    mkpath\n    sources.flatten.each do |src|\n      case src\n      when Hash\n        src.each { |from, to| install_one(from, self + to) }\n      else\n        install_one(src, self + Pathname.new(src.to_s).basename)\n      end\n    end\n  end\n\n  def install_one(src, dest)\n    src = Pathname.new(src.to_s)\n    raise \"cannot install #{src}: does not exist\" unless src.exist? || src.symlink?\n    dest.dirname.mkpath\n    FileUtils.mv src.to_s, dest.to_s\n  end\n  private :install_one\n\n  def install_symlink(*sources)\n    mkpath\n    sources.flatten.each do |src|\n      case src\n      when Hash\n        src.each { |from, to| make_relative_symlink(Pathname.new(from.to_s), self + to) }\n      else\n        src = Pathname.new(src.to_s)\n        make_relative_symlink(src, self + src.basename)\n      end\n    end\n  end\n","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/shim.rb#L221-L257","documentation":"The brew shim's `install_one` moves a built source file or symlink into its destination during formula installation. It raises when the source path neither exists nor is a symlink, meaning the build/stage step failed to produce the expected artifact before the move.","triggerScenarios":"Calling install (which fans out to install_one) with a src path that was never created — e.g. the unpacked archive layout differs from what the formula's install block expects, a build step silently skipped writing the binary, or an incorrect path string is passed.","commonSituations":"Upstream renamed or relocated the binary between releases so the formula copies from a stale path; a partially failed download produced an empty stage directory; typos in the install block's path handling inside a Homebrew formula running under mise's brew shim.","solutions":["Check the formula's install block and confirm the src path matches the actual staged artifact layout (ls the stage dir).","Verify the download/unpack step succeeded and the archive contains the expected files (checksum and archive structure).","If upstream moved the artifact, update the formula path to the new location.","Wrap the build in verbose mode to see which step failed to produce the file before the move."],"exampleFix":"# before\ninstall_one \"bin/#{name}-old\", bin\n# after\ninstall_one \"bin/#{name}\", bin  # upstream renamed the binary","handlingStrategy":"validation","validationCode":"src = Pathname.new(candidate)\nraise \"staged artifact missing: #{src}\" unless src.exist? || src.symlink?\ninstall_one(src, dest)","typeGuard":null,"tryCatchPattern":"begin\n  install_one(src, dest)\nrescue RuntimeError => e\n  raise unless e.message.start_with?(\"cannot install\")\n  # inspect stage dir, re-run or fail install\nend","preventionTips":["After build steps, assert expected artifacts exist before install","Diff staged file layout against the formula's assumptions on version bumps","Run installs with verbose output to catch silent build failures"],"tags":["ruby","brew-shim","file-not-found","install"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}