{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/shim.rb#L221-L257","documentation":"install_one is a private helper in the brew shim that moves a built file from its source path to the install destination. It raises when the source path neither exists nor is a symlink, meaning the formula's build stage never produced the artifact the install step expects to move.","triggerScenarios":"Calling install (or install_symlink) with a src path that was never created by the build step — e.g. the binary name in the formula doesn't match what the build system actually produced, or the build silently failed earlier.","commonSituations":"Formulae pinned to old versions where upstream renamed the output binary; build systems writing artifacts to a different directory (build/ vs release/); partially cleaned stage directories after an interrupted install.","solutions":["Verify the source path exists in the stage directory before install (ls the stage dir)","Check the formula's install blocks reference the actual built artifact names","Re-run the build step and confirm it succeeds before install","Ensure the stage directory wasn't cleaned between build and install"],"exampleFix":"# before\ninstall_one \"#{buildpath}/bin/mytool\", bin\n# after\nbinary = \"#{buildpath}/bin/mytool\"\nraise \"build did not produce #{binary}\" unless File.exist?(binary)\ninstall_one binary, bin","handlingStrategy":"validation","validationCode":"raise \"missing install source\" unless File.exist?(src) || File.symlink?(src)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the stage directory contains the expected artifact before installing","Match install paths exactly to what the build system emits","Fail the build step loudly instead of letting install find nothing"],"tags":["ruby","file-not-found","install"],"backgroundTag":"file-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}