Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken on MacOS Sonoma 14.1.1 #166

Open
soundstep opened this issue May 14, 2024 · 9 comments
Open

Broken on MacOS Sonoma 14.1.1 #166

soundstep opened this issue May 14, 2024 · 9 comments
Assignees

Comments

@soundstep
Copy link

soundstep commented May 14, 2024

Describe the bug

I have install the tool using brew on a mac laptop, but I've got errors displayed when I try to run it.

$ git-quick-stats
ERROR: You must have GNU date installed.
If you're on macOS, please use brew to install this utility.
Make sure the GNU version of date is symlinked to 'date', too.

I also link date to the GNU version gdate but the error remains:

$ alias date="gdate"
$ date --version
date (GNU coreutils) 9.5

To Reproduce

Steps to reproduce the behavior:

  1. Run brew install git-quick-stats
  2. run git-quick-stats

Expected behavior

The command to execute without errors.

Screenshots

Screenshot 2024-05-14 at 12 50 50 Screenshot 2024-05-14 at 13 02 43

Desktop (please complete the following information):

  • OS: MacOS Sonoma 14.1.1 (23B81)
  • OS Chip: Apple M1 Pro
  • Version: 2.5.5
@soundstep soundstep changed the title Broken on Broken on MacOS Sonoma 14.1.1 May 14, 2024
@tomice tomice self-assigned this May 14, 2024
@agoalofalife
Copy link

Yes, I have the same problem in OS Ventura

@tomice
Copy link
Collaborator

tomice commented May 14, 2024

What happens if you do you following:

  1. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  2. git quick-stats (or whatever your preferred way of launching is)

Using my 2015 MacBook Pro with macOS 14.4.1, and this appears to work on my end.

@zekida
Copy link

zekida commented May 15, 2024

What happens if you do you following:

  1. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  2. git quick-stats (or whatever your preferred way of launching is)

Using my 2015 MacBook Pro with macOS 14.4.1, and this appears to work on my end.

though the path wasn't included in my env PATH,
adding it still doesn't work for me (2023 M2 MBP macOS 14.4.1)

~/repo main
❯ export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

~/repo main
❯ date --version
date (GNU coreutils) 9.5
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

~/repo main
❯ git quick-stats
ERROR: You must have GNU date installed.
If you're on macOS, please use brew to install this utility.
Make sure the GNU version of date is symlinked to 'date', too.

@soundstep
Copy link
Author

soundstep commented May 15, 2024

Is that a Linux path? there is not path from /usr/local/opt, opt does not exist.

@tomice
Copy link
Collaborator

tomice commented May 15, 2024

I'm double-checking the Homebrew documentation from here: https://docs.brew.sh/Installation

It appears the path will be different depending on if you're on an Intel machine (like mine) or on an ARM machine:

"The script installs Homebrew to its default, supported, best prefix (/opt/homebrew for Apple Silicon, /usr/local for macOS Intel and /home/linuxbrew/.linuxbrew for Linux) so that you don’t need sudo after Homebrew’s initial installation when you brew install"

And further discussion on when it happened: https://github.com/orgs/Homebrew/discussions/664

The exact location will depend on where you installed it to and at what point in Homebrew's life you had happened to install it (previously, it appears it would install into /usr/local/bin), so I guess I should adjust the check I'm asking people to run. The above version should work for anybody on Intel with the most recent version of Homebrew as of May 2024 who used the default install paths for everything.

For everyone else, you'll need to find out where your gnubin folder is and add it to your path like I showed above. The coreutils brew package itself, I believe, says you can maybe do this:

export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"

The goal is to find where the coreutils are installed and add that gnubin folder to your PATH

@agoalofalife
Copy link

export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"

Yes it works - thank a lot
My path was (for example) export PATH="/opt/homebrew/Cellar/coreutils/9.5/libexec/gnubin/:$PATH"

@tomice
Copy link
Collaborator

tomice commented May 15, 2024

@soundstep and @zekida , can you also confirm the above example works? If so, I'll go ahead and update our documentation to make it more clear what users on macOS will need to do to get this to work for them.

@zekida
Copy link

zekida commented May 16, 2024

export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"

i can confirm it works on apple silicon. thanks for the quick fix :)

@soundstep
Copy link
Author

soundstep commented May 16, 2024

Thanks @tomice for looking into that.
It is working with:

export PATH="$PATH:/opt/homebrew/Cellar/coreutils/9.5/libexec/gnubin/"

And:

alias date="gdate"

gdate is the GNU version, testable with date --version which doesn't work with the other one

Probably worth adding to a doc?
Cheers!

tomice added a commit to tomice/git-quick-stats that referenced this issue May 16, 2024
* Added additional information to better explain how to use this
  on macOS.

* Updated some of the deps used

* Minor adjustments in the README.md

Addresses Issue arzzen#166
tomice added a commit to tomice/git-quick-stats that referenced this issue May 16, 2024
* Added additional information to better explain how to use this
  on macOS.

* Updated some of the deps used

* Minor adjustments in the README.md

Addresses Issue arzzen#166
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

No branches or pull requests

4 participants