Skip to content

Conversation

@hirotaka
Copy link

@hirotaka hirotaka commented Oct 6, 2025

What's the problem?

When following the README instructions and running brew tap tobi/try, I got this error:

$ brew tap tobi/try
Error: Failure while executing; git clone https://github.com/tobi/homebrew-try /opt/homebrew/Library/Taps/tobi/homebrew-try --origin=origin --template= --config core.fsmonitor=false exited with 128.

This happens because there's no homebrew-try repository. The repo is named try, which doesn't follow Homebrew's naming convention (homebrew-*).

Then I tried brew install try directly instead, I got a SHA256 mismatch error:

$ brew install try
==> Fetching downloads for: try
==> Fetching dependencies for tobi/try/try: openssl@3 and ruby
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.6.0
################################################################################################################################################################################## 100.0%
==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:9a8fa2ae1ef3424b116d7e6422d979e0290f4affdef072b1592e4535d2617d92
################################################################################################################################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ruby/manifests/3.4.6
################################################################################################################################################################################## 100.0%
==> Fetching ruby
==> Downloading https://ghcr.io/v2/homebrew/core/ruby/blobs/sha256:8db26d72de0d97182fa05e1cc48f2e86ab03c040831f2087705fc94eb0d067a0
################################################################################################################################################################################## 100.0%
==> Fetching tobi/try/try
==> Downloading https://github.com/tobi/try/archive/refs/heads/main.tar.gz
==> Downloading from https://codeload.github.com/tobi/try/tar.gz/refs/heads/main
#=#=-  #      #
Error: try: SHA-256 mismatch
Expected: dd3753f38b5c35597c8c2528a19efd7e4289bbbe977d18e2e299a2a57b393a8e
  Actual: 151778fdd07adac23fb021d2d84bd0756e0d626a97498503da24413bfdd72c28
    File: /Users/hirotaka/Library/Caches/Homebrew/downloads/7fef3f3e550762c030552960944b4df9886ae8802c0860c1459dcf5b45ed904a--try-main.tar.gz
To retry an incomplete download, remove the file above.

This is because the formula uses an archive URL for the main branch (archive/refs/heads/main.tar.gz), so the hash changes every time main is updated.

How this fixes it

  1. Formula/try.rb: Switch to using head

    • Removed url and sha256 (these were causing the mismatch)
    • Removed version "main" (invalid version string)
    • Added head to reference the main branch directly
  2. README.md: Updated with correct installation instructions

    • Fixed to use two-argument brew tap command (explains why full URL is needed)

How to install now

brew tap tobi/try https://github.com/tobi/try
brew install try

I hope it should work now!

- Switch from main branch archive to HEAD to avoid SHA256 mismatches
- Update README with correct two-argument tap command
- Remove invalid version string
- Add note explaining repository naming
homepage "https://github.com/tobi/try"
url "https://github.com/tobi/try/archive/refs/heads/main.tar.gz"
sha256 "dd3753f38b5c35597c8c2528a19efd7e4289bbbe977d18e2e299a2a57b393a8e"
version "main"
Copy link

@saiqulhaq saiqulhaq Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried your GitHub branch and installed the formula locally
I got this error:

Error: invalid attribute for formula 'xxx/try/try': version (nil)

Final code that works:

class Try < Formula
  desc "Fresh directories for every vibe - lightweight experiments for people with ADHD"
  homepage "https://github.com/hirotaka/try"
  head "https://github.com/hirotaka/try.git", branch: "fix-homebrew-formula"
  url "https://github.com/tobi/try/archive/refs/heads/main.tar.gz"
  version "main"

  depends_on "ruby"

  def install
    bin.install "try.rb" => "try"
  end

  def caveats
    <<~EOS
      To set up try with your shell, add one of the following to your shell configuration:

      For bash/zsh:
        eval "$(try init ~/src/tries)"

      For fish:
        eval "(try init ~/src/tries | string collect)"

      You can change ~/src/tries to any directory where you want your experiments stored.
    EOS
  end

  test do
    system "#{bin}/try", "--help"
  end
end

Copy link

@thiagowfx thiagowfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brew tap tobi/try https://github.com/tobi/try is indeed necessary, otherwise brew attempts to clone https://github.com/tobi/homebrew-try which does not exist.

@buritica
Copy link

buritica commented Dec 3, 2025

Seems like there is also an issue with the checksum

Error: Formula reports different checksum: 151778fdd07adac23fb021d2d84bd0756e0d626a97498503da24413bfdd72c28
==> Tapping tobi/try
Cloning into '/opt/homebrew/Library/Taps/tobi/homebrew-try'...
remote: Enumerating objects: 383, done.
remote: Counting objects: 100% (240/240), done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 383 (delta 169), reused 168 (delta 124), pack-reused 143 (from 1)
Receiving objects: 100% (383/383), 276.50 KiB | 1.54 MiB/s, done.
Resolving deltas: 100% (224/224), done.
Tapped 1 formula (53 files, 619.7KB).
💀 🏡  [4:35:30] buritica:src$ s
💀 🏡  [4:35:34] buritica:src $ brew install try
==> Fetching downloads for: try
✔︎ Bottle Manifest libyaml (0.2.5)                                                                                                                              [Downloaded   14.5KB/ 14.5KB]
✔︎ Bottle libyaml (0.2.5)                                                                                                                                       [Downloaded  110.8KB/110.8KB]
✔︎ Bottle Manifest ca-certificates (2025-12-02)                                                                                                                 [Downloaded    2.0KB/  2.0KB]
✔︎ Bottle ca-certificates (2025-12-02)                                                                                                                          [Downloaded  131.8KB/131.8KB]
✔︎ Bottle Manifest ruby (3.4.7)                                                                                                                                 [Downloaded   16.1KB/ 16.1KB]
✔︎ Bottle ruby (3.4.7)                                                                                                                                          [Downloaded   16.1MB/ 16.1MB]
✘ Formula try (main)                                                                                                                                           [Verifying   165.5KB/  0.0 B]
Error: Formula reports different checksum:  151778fdd07adac23fb021d2d84bd0756e0d626a97498503da24413bfdd72c28
       SHA-256 checksum of downloaded file: a74e17d0c4ed29998d2a07e86872409b9e04eadc15ddb4e2ef1b7731648ba588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants