I've updated my macOS to Big Sur 11.3.1 and reinstall the xcode command. When I run bundle install for my Gemfile (I didn't use rail), it occurs error when install the gem http-parser 1.2.3.
Then it occurs the error:
Errno::EACCES: Permission denied # rb_sysopen - /Users/relaxlalalala/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete
I've tried
sudo chown -R relaxlalalala .rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete
but it said
chown: .rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-18/3.0.0/http-parser-1.2.3/gem.build_complete: No such file or directory
How can I get the folder permission or resolve the gem.build_complete problem?
What should the permissions be?
Looking at my own rbenv installation,
I own all files under ~/.rbenv, and
directories under ~/.rbenv are drwxr-xr-x (755) and
files are either -rw-rw-r-- (664) or
-rwxrwxr-x (775), if they are meant to be executable.
Recommendation
Just reinstall everything :)
rbenv uninstall 3.0.1
rbenv install 3.0.1
bundle install
Related
When I run brew install {package}, I get the following:
ln: /usr/local/bin/{package}: Permission denied
But if I try to use sudo brew install {package}, I get the following:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
How do I get homebrew working again?
You can fix permissions for Homebrew by running:
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var Frameworks
See this answer for details: https://stackoverflow.com/a/44208097/1807667
Have to re-install ruby on our server because our Rails installation is failing (some OpenSSL error).
I successfully uninstalled it by running $sudo rm -rf $(rbenv prefix 1.9.3-p194) Because the command rbenv uninstall failed. Then I couldn't $rbenv rehash because:
rbenv: cannot rehash: /usr/local/rbenv/shims/.rbenv-shim exists
But I'm not sure if that matters.
Anyways now when I try to run $rbenv install -v 1.9.3-p194 I get a permission denied error:
cannot create directory '/usr/local/rbenv/versions/1.9.3-p194': Permission denied
But when I run $sudo rbenv install -v 1.9.3-p194 the ruby is installed successfully in /home/anbranin/.rbenv/versions/1.9.3-p194, which is NOT where it's supposed to be, right? It's supposed to be in /usr/local.
Total newbie here trying to run a legacy rails application--our devops person is out--so I'm lacking in knowledge about Linux servers.
My only idea at this point is to just sudo mv the files to usr/local but will that work?
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
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.
I'm trying to setup gitlab and thus install some gems from another user account using sudo,
but I'm constantly getting Permission denied error.
sudo -u gitlab -H bundle install --deployment --without development test postgres
> Using ... ( a lot of successful gems there )
> Using pygments.rb (0.3.2) from https://github.com/gitlabhq/pygments.rb.git (at master)
> Errno::EACCES: Permission denied - pygments.rb-0.3.2.gem
> An error occurred while installing pygments.rb (0.3.2), and Bundler cannot continue.
> Make sure that `gem install pygments.rb -v '0.3.2'` succeeds before bundling.\
sudo -u gitlab -H gem install pygments.rb -v '0.3.2'
> Successfully installed pygments.rb-0.3.2
> 1 gem installed
> Installing ri documentation for pygments.rb-0.3.2...
> Installing RDoc documentation for pygments.rb-0.3.2...
# no matter how many times I run this command, I always get the same output
# as if the gem installation doesn't stick
# I've tried to chmod
chmod 777 -R /usr/local/lib/ruby
# then Again
sudo -u gitlab -H bundle install --deployment --without development test postgres
# same result, Errno::EACCES: Permission denied - pygments.rb-0.3.2.gem
Lain suggested to try to install the bundles into another sub directory. When that worked out, it became clear the problem was about permissions in the current directory.
Executing chown -R gitlab:gitlab . has solved the problem.
In the gitlab installation guide there is a gem install command preceding our story that was ran as root and probably the gemfile or some other file had permissions change during that.
This is a permissions bug in ruby-2.0.0-p195 rvm with bundle install
are you using rvm? did you try chmod with sudo?
chmod 755 (or 777) ~/.rvm/gems/ruby-2.0.0-p195/build_info/
I did the following and got things working.
I changed the permission for the Gemfile. i.e. chmod 755 Gemfile
Then I did a sudo bundle install. This got things working and all the gems got installed. I could then start my app by rails server
Make sure your Gemfile.lock is owned by the user running the command
Although Alex's answer is correct,this worked for me as well
sudo chown -R git:git /path/to/external/volume
I'm using Digital Ocean's Gitlab Image