Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Homebrew in a Mac

I am trying to install Homebrew in a Mac v 10.12.2 using

brew install node

But I got these errors:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Library/brew.rb:15:in `<main>'
like image 669
Nunyet de Can Calçada Avatar asked Jan 09 '17 17:01

Nunyet de Can Calçada


People also ask

Should I install Homebrew on my Mac?

Homebrew fills the void as the de facto package manager for macOS (and as another option for Linux). It provides an incredibly smooth and straightforward experience for anyone familiar with the command line, and it's a good way to learn the command line if you're new to it.

Where should Homebrew be installed Mac?

On Mac Intel, Homebrew installs itself into the /usr/local/bin directory, which is already configured for access by the shell with the macOS default $PATH environment variable (the default is set by the /usr/libexec/path_helper command).

Where is Homebrew installed on Mac M1?

But if you install Homebrew on an M1 Mac running Apple Silicon, then Homebrew gets installed in /opt/homebrew/bin . Since /opt/homebrew/bin is not included in your PATH by default, there is some extra configuration needed to allow you to use packages installed with Homebrew.

Is Homebrew legal Mac?

Software is largely the same whether you install it from the command line or the Mac App Store. Homebrew as a distribution mechanism is perfectly safe and open source.


1 Answers

1-First, install Homebrew.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2-Then run brew update to make sure Homebrew is up to date.

brew update

3-As a safe measure you should run brew doctor to make sure your system is ready to brew. Run the command below and follow any recommendations from brew doctor.

brew doctor

4-Next, add Homebrew's location to your $PATH in your .bash_profile or .zshrc file.

export PATH="/usr/local/bin:$PATH"

5-Next, install Node (npm will be installed with Node):

brew install node

6-To test out your Node and npm install, try installing Grunt (you might be asked to run with sudo):

npm install -g grunt-cli
like image 123
Eduardo Sampaio Avatar answered Sep 18 '22 17:09

Eduardo Sampaio