Asked 7 years ago
17 Sep 2016
Views 1275
QuickIos

QuickIos posted

permission error on the ruby install

some reason brew update don't work
i tried first

brew update


it give me error


/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>'

than i thought i should re-install ruby

so i installed first ram and than try to install it again


ram install ruby-2.3.1

ERROR: '/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.


brew doctor 


its give me same mess

/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>'

i don't what is issue with brew . its file permission issue or other don't know ?

ruby-rails

ruby-rails
answered Nov 30 '-1 00:00

i think you messed up with ruby when you updating .so possibly revert to previous commit
so what we will do is
1. revert to previous commit -- command is - "git reset -hard"
2.clean all untracked file -- command is - "git clean -d -f"
3. again update brew -- command is "brew update"

so run at terminal

[code ]
git reset --hard
[/code]

so you now back to pervious commit

as result of the above command it will checkout all file and will show where is at HEAD now
and now use git clean command to remove untracked file from the working tree

git clean -d -f 

here -d for remove whole directories
and -f for force clean

and now update brew

brew update


Hope it work
your instruction work for me ==> Migrating Homebrew to v0.9.9 remote: Counting objects: 924, done. remote: Compressing objects: 100% (806/806), done. remote: Total 924 (delta 231), reused 529 (delta 89), pack-reused 0 Receiving objects: 100% (924/924), 853.42 KiB | 136.00 KiB/s, done. Resolving deltas: 100% (231/231), completed with 159 local objects. From https://github.com/Homebrew/brew + 73a2e75...299dffd master -> origin/master (forced update) HEAD is now at 299dffd Merge pull request #988 from MikeMcQuaid/move-linkedkegs-migration To restore the stashed changes to /usr/local run: “cd /usr/local && git stash pop” ==> Homebrew has enabled anonymous aggregate user behaviour analytics Read the analytics documentation (and how to opt-out) here: https://git.io/brew-analytics ==> Tapping homebrew/core Cloning into “/usr/local/Library/Taps/homebrew/homebrew-core”… remote: Counting objects: 3728, done. remote: Compressing objects: 100% (3616/3616), done. remote: Total 3728 (delta 15), reused 1506 (delta 4), pack-reused 0 Receiving objects: 100% (3728/3728), 2.92 MiB | 122.00 KiB/s, done. Resolving deltas: 100% (15/15), done. Checking connectivity... done. Tapped 3607 formulae (3,755 files, 9M) ==> Cleaning up /Library/Caches/Homebrew... Removing: /Library/Caches/Homebrew/pkg-config-0.28.tar.gz... (1.8M) ==> Migrating /Library/Caches/Homebrew to /Users/d/Library/Caches/Homebrew... ==> Deleting /Library/Caches/Homebrew... Already up-to-date. - QuickIos  
Sep 18 '16 08:51
jagdish

jagdish
answered Nov 30 '-1 00:00

use this to change file permission

sudo chown -R `whoami`:admin /usr/local/bin



than enter password of administrator



Post Answer