Permission denied #rb_system when attempt to install httpd using Homebrew - ruby

I want to install httpd using Homebrew but I keep getting this error -
Error: Permission denied # rb_sysopen - /tmp/github_api_headers20180612-63207-1943ua6
I tried - sudo chmod -R 1777 /tmp but that is not working
This is the current permission set for /tmp
drwxr-xr-x 8 _mysql _mysql 256 Jun 12 18:39 tmp
Here is some information on my mac air
System Version: macOS 10.13.5 (17F77)
Kernel Version: Darwin 17.6.0
Even when I attempt to update ruby it gives me this error
[2018-06-12 18:13:32] requirements_osx_brew_libs_install
requirements_osx_brew_libs_install ()
{
brew install "$#" --force || {
\typeset ret=$?;
requirements_osx_brew_libs_error "installation";
case "$_system_version" in
10.6)
rvm_warn "
On OSX 10.6 instead of command line tools install:
https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.6.pkg"
;;
esac;
return $ret
}
}
current path: /Users/iivri.andre
PATH=/Library/Frameworks/Python.framework/Versions/3.5/bin:/Users/iivri.andre/.sdkman/candidates/gradle/current/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/iivri.andre/.rvm/bin
command(10): requirements_osx_brew_libs_install autoconf automake libtool pkg-config coreutils libyaml readline libksba openssl#1.1
++ brew install autoconf automake libtool pkg-config coreutils libyaml readline libksba openssl#1.1 --force
Error: Permission denied # rb_sysopen - /tmp/github_api_headers20180612-55209-1k19y8s
How can I correct this issue?

Related

I can't uninstall brew on MacOS Apple Silicon

Like it is mentioned here https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew I typed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" but it doesn't seem to work...
When I type afterwards which brew it returns /usr/local/bin/brew
and when I type again /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
It displays :
/bin/bash: line 236: /opt/homebrew/bin/brew: No such file or directory
Failed to locate Homebrew!
So I don't know what to do to uninstall brew.
My ultimate goal is to not getting this error when I try to install a brew package :
Error: Cannot install in Homebrew on ARM processor in Intel default
prefix (/usr/local)! Please create a new installation in /opt/homebrew
using one of the "Alternative Installs" from:
https://docs.brew.sh/Installation You can migrate your previously
installed formula list with: brew bundle dump
I now have a Mac with Apple Silicon but I used to have a Intel Mac.
EDIT 1 : I took a quick look at the uninstall.sh script here https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
It seems that my problem is induced by my os installation because I did it from an Intel-based MacOS time machine backup. The problem is the uninstall.sh script is programed to uninstall homebrew according to the current os. So this script can only uninstall the ARM homebrew that I need and can't uninstall the Intel homebrew I try to get rid of...
Maybe I should try to just change the line of code that detect I have a ARM CPU to make the script think I have a Intel-based Mac but I don't know if it could bring chaos in my computer...
I'm surprised there's not a lot of answers about this problem since I don't think I'm the only one to have switched from Intel-based Mac to ARM-based Mac with Time Machine.
EDIT 2 : I tried to uninstall Homebrew with a command of my own arch -x86_64 ./uninstall_brew.sh (I have no idea if it's not DANGEROUS) but I don't know if it worked well...
Here is the output of the command :
user#MacBook-Pro % arch -x86_64 ./uninstall_brew.sh
Warning: This script will remove:
/Users/user/Library/Caches/Homebrew/
/usr/local/Caskroom/
/usr/local/Cellar/
/usr/local/bin/brew -> /usr/local/bin/brew
Are you sure you want to uninstall Homebrew? This will remove your installed packages! [y/N] y
==> Removing Homebrew installation...
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
/usr/local/share/info/dir: Permission denied
Warning: Failed to delete /usr/local/Caskroom
rm: /usr/local/Caskroom: Permission denied
Warning: Failed to delete /usr/local/Cellar
rm: /usr/local/Cellar: Permission denied
==> Removing empty directories...
Password:
==> /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Caskroom /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks -name .DS_Store -delete
==> /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Caskroom /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks -depth -type d -empty -exec rmdir {} ;
==> Homebrew uninstalled!
The following possible Homebrew files were not deleted:
/usr/local/.com.apple.installer.keep
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/git/
/usr/local/include/
/usr/local/lib/
/usr/local/man/
/usr/local/opt/
/usr/local/remotedesktop/
/usr/local/sbin/
/usr/local/share/
/usr/local/var/
You may wish to remove them yourself.
Try running: PATH=/usr/local/bin:$PATH arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Found the answer here: https://github.com/Homebrew/discussions/discussions/3437
I encounter similar issue on my M1 MBP, and I found that changing the uninstall path in the script may work.
First, I download a local copy of the uninstalling script
curl -O https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
Then run the script locally and set the path to /user/local(which is the default path of homebrew on intel Mac)
/bin/bash uninstall.sh --path=/usr/local
but it completed with 2 warnings I'm not sure what they are
Warning: Failed during: /usr/bin/sudo rmdir /usr/local
Warning: Homebrew partially uninstalled (but there were steps that failed)!
To finish uninstalling rerun this script with `sudo`.
The following possible Homebrew files were not deleted:
/usr/local/Cellar/
/usr/local/Frameworks/
/usr/local/Homebrew/
/usr/local/bin/
/usr/local/etc/
/usr/local/include/
/usr/local/lib/
/usr/local/opt/
/usr/local/sbin/
/usr/local/share/
/usr/local/texlive/
/usr/local/var/
You may wish to remove them yourself.
Either way, I delete those files manually.
(This is my first time to answer something on stack overflow. Hope this help!)

brew update fails with "Permission denied" error

I have been trying to upgrade my brew installation on Mac and it always fails with the following error:
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied # dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied # dir_s_mkdir - /usr/local/Frameworks
I do not want to run brew as sudo, but is there a way to fix this error? I'm not able to install Python3 which is my ultimate goal. Is there another way to install Pythion3 on Mc other than brew? Is there any resolution for this problem here?
EDIT: I tried to remove python3 and tried to re install it again and this time it fails with some other message:
==> Pouring python-3.6.5.high_sierra.bottle.1.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied # dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied # dir_s_mkdir - /usr/local/Frameworks
Try to change owner of /usr/local.
if you use macOS High Sierra or higher try this command:
sudo chown -R $(whoami) $(brew --prefix)/*
if you use macOS Sierra or lower:
sudo chown -R $(whoami) /usr/local
In Mac OSX Mojave, installing Python3, I solved this issue by the following:
sudo mkdir /usr/local/Frameworks
sudo chown -R user:group /usr/local/Frameworks/
brew link python
Where user and group are specified as set by the OS. You can find out what user/group values should be by doing:
ls -al /usr/local
And then python3 was successfully installed:
> python3
Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[.Clang 10.0.0 (clang-1000.11.45.5)] on darwin

ruby "permission denied" installing/using homebrew cask

My wild bet is that this issue is somehow related to my base osx ruby setup... but as I'm not a ruby-ite, i need some guidance to discover more.
A couple days ago i tried to install a brew cask formula (several others were already installed previously). A couple weeks ago i upgraded to OSX Sierra.
Brew itself works perfectly, brew cask does not.
I get an "unexpected" error when I type brew cask by itself or with any subcommand:
Error: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_str_replace() in ruby.h... yes
creating Makefile
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:2125:in `initialize': Permission denied - Makefile (Errno::EACCES)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:2125:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:2125:in `create_makefile'
from extconf.rb:24:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/msgpack-0.5.8 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/msgpack-0.5.8/gem_make.out
I've looked through many questions and tried many of the answers given, all to no avail.
Questions:
Homebrew cask option not recognized?
Failed to build gem native extension (installing Compass)
homebrew not working on OSX Can't install Brew
formulae correctly (Permission denied in /usr/local/lib)
OsX, can't use Homebrew because of Ruby permission
Attempts:
> xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
> brew install ruby
Warning: ruby-2.4.0 already installed
> ls -l /System/Library/Frameworks/Ruby.framework/Versions/
drwxr-xr-x 7 root wheel 238 2017-01-12 12:12:13 2.0
lrwxr-xr-x 1 root wheel 3 2017-01-09 09:47:51 Current -> 2.0
> sudo chown -R $(whoami):admin /usr/local
> sudo chmod -R g+w /usr/local
> brew install caskroom/cask/brew-cask
> brew cask [list|cleanup|update|etc]
(gives error shown above)
Performed a complete homebrew uninstall, rm'ing extra dirs and files. Then complete homebrew re-install, followed by re-install many of the formulae I had previously.
Same commands above give same errors after reinstall.
Color me confused. 😕
So I just resolved something similar - it was a permissions issue for me. I ended up running:
sudo chown -R $(whoami) your-directory-here
on the Cask and caskroom directories - you may have to look around a little bit to find those directories on your system.

Install git via homebrew on mac osx 10.10 results in: Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2

Hi I just tried installing git via homebrew on my mac - something is wrong. I had the github for mac app installed, but I tried removing that. The current git version in my system is:
Nielsk#~: $ git --version
git version 1.9.3 (Apple Git-50)
This is what happens if I try to install git via homebrew:
Nielsk#~: $ brew install git
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-2.1.3.y
######################################################################## 100,0%
==> Pouring git-2.1.3.yosemite.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
How can I solve this?
I also met the same issue. I think we should change the readable permission to make sure any of the directories is readable by "all". So I tried the command: sudo chown -R $USER:admin /usr/local
and then: brew link --overwrite git It works for me, hope it will also work for you.
From High Sierra, chown of /usr/local is not allowed. However you can still change permission the sub directories in /usr/local.
In my case, I had to create Frameworks in /usr/local and sudo chown -R $(whom) Frameworks. After that follow what brew doctor says.
The better way is to create subdirectory whatever you need and run
sudo chown -R $(whoami) $(brew --prefix)/*
For those with the new El Capitan OS, you'll need to update your permissions:
Open Terminal and type the following commands:
$ sudo chown -R $(whoami):admin /usr/local
$ brew doctor
$ brew update
$ brew link --overwrite git
The above solution will work for other brew installs like node, etc. Just replace the last line if you started the installation but encountered errors during the brew installation.
I had a similar permission denied error on install of git until I cleaned things up:
$brew doctor
..... << long output of issues, so you run:
$brew prune
$brew doctor
..... << less issues now, so manually clean up
$brew update
$brew install git
Does that address your error as well?
I did what brew doctor recommended and it helped:
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin
MacOS 10.14.4

brew install v8 : make: *** [out/Makefile.native] Error 127

When I used the command: brew install v8, I got the output as follows:
==> Downloading https://github.com/v8/v8/archive/3.19.18.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/v8-3.19.18.4.tar.gz
==> make dependencies
==> make native -j8 library=shared snapshot=on console=readline
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. -S.native -Dcomponent=shared_library - Dconsole=readline -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default
env: python: No such file or directory
make: *** [out/Makefile.native] Error 127
I have install python through homebrew, so I cannot understand why it says: 'python: No such file or directory'
brew --config:
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 2f6dc2694b6af3b827617cfabf8230d6013b137d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
GCC-4.2: build 5666
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Python is installed but may be is not in your path, you could add this to your PATH variable in your shell startup script like .bashrc
Temporal solution could be to run this inside your shell
export PATH=$PATH:/usr/bin/:/usr/local/bin

Resources