orta / cocoapods-keys

A key value store for storing per-developer environment and application keys
MIT License
1.55k stars 92 forks source link

ERROR: While executing gem ... (Gem::FilePermissionError) #190

Open RaziPour1993 opened 5 years ago

RaziPour1993 commented 5 years ago

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

ashfurrow commented 5 years ago

Did you perhaps install this with sudo gem install cocoapods-keys? I'd recommend installing without sudo, instructions are here: https://guides.cocoapods.org/using/getting-started.html#sudo-less-installation

Basically, if you install with sudo then the gem "belongs" to the superuser and not you. This would require you to run sudo pod install, for example (please don't do this!).

Vinaybandarapu commented 1 year ago

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory. /Library/Ruby/Site/2.6.0/rubygems/installer.rb:712:in verify_gem_home' /Library/Ruby/Site/2.6.0/rubygems/installer.rb:902:inpre_install_checks' /Library/Ruby/Site/2.6.0/rubygems/installer.rb:302:in install' /Library/Ruby/Site/2.6.0/rubygems/resolver/specification.rb:104:ininstall' /Library/Ruby/Site/2.6.0/rubygems/request_set.rb:194:in block in install' /Library/Ruby/Site/2.6.0/rubygems/request_set.rb:182:ineach' /Library/Ruby/Site/2.6.0/rubygems/request_set.rb:182:in install' /Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:214:ininstall_gem' /Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:230:in block in install_gems' /Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:223:ineach' /Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:223:in install_gems' /Library/Ruby/Site/2.6.0/rubygems/commands/install_command.rb:169:inexecute' /Library/Ruby/Site/2.6.0/rubygems/command.rb:323:in invoke_with_build_args' /Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:251:ininvoke_command' /Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:191:in process_args' /Library/Ruby/Site/2.6.0/rubygems/command_manager.rb:149:inrun' /Library/Ruby/Site/2.6.0/rubygems/gem_runner.rb:51:in run' /usr/bin/gem:21:in

'

I deleted those directories by using the below command :-

sudo rm -rf \ /Library/Ruby/Gems/2.6.0/{build_info,cache,doc,extensions,gems} \ /Library/Ruby/Gems/2.6.0/specifications/*.gemspec \ /Library/Ruby/Site

then installed cocopods using sudo gem install -n /usr/local/bin cocoapods , and cocoapods installed successfully for me.

Venkatesh63740 commented 11 months ago

please @Vinaybandarapu instruction it is worked for me great........! thanks man.....:)