Hi!
I’m new to discord and using home-brew and all so I hope I’m posting this with all information you need. Please let me know otherwise.
I am trying to install Hugo on Mac using homebrew. When I installed it, it’s located in /opt/homebrew/bin/hugo, and I can’t run the program. For your information, I use MacBook Pro 13-inch, M1, 2020, with macOS of Monterey version 12.5.1.
Below is detailed walk-through of what I did.
I followed the instruction provided in below webpage:
https://gohugo.io/getting-started/installing/
First, I visited the Homebrew website and copied the code into my terminal as below.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
When it ran it, it produced the following warning:
Warning: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the ‘Next steps’ section below.
I googled that exact warning I showed you above. Someone recommended to type in the two lines of code in terminals so that’s what I did. Here are the two codes:
export PATH=/opt/homebrew/bin:$PATH
followed by
source ~/.zshrc
And then I also saw another person pointing out how there’s the instruction of ‘Next Steps’ that we are neglecting. The following is the Next Step which was printed out in my terminal after the warning sign. :
- Run these two commands in your terminal to add Homebrew to your PATH:
echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”’ >> /Users/u1317537/.zprofile
eval “$(/opt/homebrew/bin/brew shellenv)”
So I ran these two lines of code as below.:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/u1317537/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
And then, I proceeded with the following code to install hugo.:
brew install hugo
And I tried to check the directory where hugo was installed by typing the following.:
which hugo
What I got out from it is /opt/homebrew/bin/hugo. When I execute the below code,
hugo
I get the following error:
Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
Run hugo help new
for details.
Total in 0 ms
I think the hugo was supposed to have been installed in local, but it’s not. Could you please help me with fixing the issue? Thank you!