Cocoapods: LoadError - no such file to load - ios

I am trying to add a pod to my Xcode project. I am getting this error:
LoadError - no such file to load -- xcodeproj/prebuilt/universal-darwin13.0-1.8.7/xcodeproj_ext
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in require'
/Library/Ruby/Gems/1.8/gems/xcodeproj-0.14.0/lib/xcodeproj/ext.rb:6
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in gem_original_require' /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in require'
/Library/Ruby/Gems/1.8/gems/xcodeproj-0.14.0/lib/xcodeproj/project.rb:4
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:488:in compute_target_platforms' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in each'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:485:in compute_target_platforms' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer/analyzer.rb:55:in analyze'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:171:in analyze' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:94:in resolve_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/user_interface.rb:52:in section' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:93:in resolve_dependencies'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/installer.rb:86:in install!' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:38:in run_install_with_update'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command/project.rb:68:in run' /Library/Ruby/Gems/1.8/gems/claide-0.3.2/lib/claide/command.rb:206:in run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/lib/cocoapods/command.rb:51:in run' /Library/Ruby/Gems/1.8/gems/cocoapods-0.27.1/bin/pod:19 /usr/bin/pod:23:in load'
/usr/bin/pod:23
My podfile contents:
pod 'RestKit', '~> 0.21.0'
Any help would be appreciated!

I also was seeing this. Running this fixed the issue:
sudo gem install cocoapods && pod install

Finally found a solution: I'm running old Xcode4 and new Xcode5 in same machine with same projects. At some point I seem to have lost command line tools (and iPhone5 simulator).
Reinstalling command line tools solved the problem for me. Since Xcode 4.6.3 menu item Xcode - Preferences - Downloads - Components didn't have command-line tools any more for unknown reasons, here is another way to install them:
xcode-select --install
--install
Opens a user interface dialog to request automatic installation of the
command line developer tools.
Now running "pod install" worked just fine.

if you are using 10.10 and are seeing this error (/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:) try this
Open Xcode 6 > Preferences > Locations
Command Line Tools version to Xcode 6.0
Uninstall cocoapods/xcodeproj then re-install.
sudo gem uninstall cocoapods
sudo gem uninstall xcodeproj
sudo gem install xcodeproj
sudo gem install cocoapods
pod --version

As follow, this my problem:
/usr/local/Cellar/ruby/2.5.0_2/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- Xcodeproj (LoadError)
from
/usr/local/Cellar/ruby/2.5.0_2/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from Script/ModuleDiscover.rb:9:in `'
Just attempt many method, and it is no use , finnaly I resolve the problem just bellow:
1、command + q,exit xcode
2、open terminal and "open -a xcode". all fine

Files added in the pods but their reference is not considered until you run the command pod install. Just runt the bellow command:
pod install

For the M1 mac, please install CocoaPods from Homebrew as installing CocoaPods from gem doesn't seem to work. Visit brew.sh for more information.
brew install cocoapods

Related

Pod init & Pod install Failure - iOS Xcode beta 14.0

I have issue while I tried to do pod init or pod install,
getting following errors.
Using Xcode 14 beta & OS version 12.4. Since after Xcode and OS update have issues,
pod install
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring executable-hooks-1.6.1 because its extensions are not built. Try: gem pristine executable-hooks --version 1.6.1
Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
Analyzing dependencies
[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
/usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
from /Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
from /Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
from /Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `load'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'
/Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
from /Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1190:in `block (2 levels) in inspect_targets_to_integrate'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1189:in `each'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1189:in `block in inspect_targets_to_integrate'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1184:in `inspect_targets_to_integrate'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:106:in `analyze'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
from /Users/azeemazeez/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `load'
from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'
I have several solutions like,
uninstall cocoa pods and reinstalled.
I tried brew update as well
brew update
brew install fastlane
fastlane install_plugins
None of them worked out for me. Still getting above errors.
I changed the Project Format from Xcode 14.0 to Xcode 13.0 and it worked for me.
This may be the issue:
Smart quotes were detected and ignored in your Podfile.
Try to check your Podfile in some text editor like vscode, vim or nano and substitute all the quotes with new ones
I was not able to fix the issue in Xcode beta, tried to change the path sudo xcode-select cocoapods uninstalled and reinstalled, gem installed, brew everything but nothing worked.
Then changed the version Xcode beta 14.0 to Xcode 13.4.
After that tried,
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
then pod deintegrated
pod deintegrate
finally
pod install
then started working...
Change project compatibility to 13.0 - worked for me :)
right here
First run in the terminal of your project
sudo gem update xcodeproj
Then run
pod init
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"
end
end
end
end
It worked for me for xcode 14 beta.
sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer
XCODE 14.2 WITH M1Chip and M2Chip working 100%
I faced a similar issue after 3 to 4 hours tried i found the this soultion , by default system ruby version is being used, we need to bypass it and then continue with cocoa pods.
1.Install ruby using homebrew
brew install ruby
By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/2.7.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.
If you need to have ruby first in your PATH run (and replace user_name with your username):
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
For compilers to find ruby you may need to set:
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
Follow the instructions to set PATH. Replace user_name with your username
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile
source ~/.bash_profile
Check your path
ruby -v
Then we will get this one in the terminal
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin20]
user#MacBook-Air ios % which ruby
/usr/local/opt/ruby/bin/ruby
That's it, ruby version is all set Install cocoa pods then you are good to go
sudo gem install -n /usr/local/bin cocoapods
Later add your project target and pod init
it works fine

can't run pod setup - cannot load such file -- cocoapods-core (LoadError)

I'm trying to install cocoapods so I can install a firebase plugin for my cordova app. I ran sudo gem install cocoapods and the gem was successfully installed. then when I tried to run pod setup it gave me some error, tried googling the solution, one of them was to uninstall cocoapods and run sudo gem update --system. did that, re-installed cocoapods, ran pod setup again, but now i'm getting a different error. this is what my terminal shows me after running pod setup:
Traceback (most recent call last):
10: from /Users/almiraputrisandy/.rvm/gems/ruby-head/bin/ruby_executable_hooks:24:in `<main>'
9: from /Users/almiraputrisandy/.rvm/gems/ruby-head/bin/ruby_executable_hooks:24:in `eval'
8: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/bin/pod:23:in `<main>'
7: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/bin/pod:23:in `load'
6: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/gems/2.7.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
5: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
4: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
3: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/gems/2.7.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:17:in `<top (required)>'
2: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/gems/2.7.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:23:in `<module:Pod>'
1: from /Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/almiraputrisandy/.rvm/rubies/ruby-head/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- cocoapods-core (LoadError)
I can't seem to find the solution for this, so if anyone knows a solution, please help me! My Macbook's OS is HighSierra 10.13.6. Thank you in advance!
I have solved my problem by running the following:
$ sudo gem uninstall cocoapods-core cocoapods-downloader cocoapods
$ sudo gem install cocoapods
if you get a LoadError - cannot load such file -- cocoapods_deintegrate error after running pod install after running the 2 commands above, run this command to solve the problem:
$ sudo gem install cocoapods-deintegrate
Thank you to these two answers that helped me:
https://stackoverflow.com/a/32232410/8076737
https://github.com/CocoaPods/CocoaPods/issues/5111#issuecomment-204694892
It appears that Cocoapods doesn't like using Ruby installed via rvm or rbenv. If you're using these version managers for Ruby switch to the system Ruby
For rvm
rvm use system
For rbenv
rbenv global system
You'll probably want to switch back after you're done as system Ruby is terrible for development and if you're using rbenv/rvm you're likely doing Ruby development.
After switching to system Ruby pod setup worked fine for me.
edit: In general doing sudo anything is very bad practice. If you're required to do that your environment is setup wrong and while it may get you past this problem more bigger problems are heading your way.

error running pod install error launching application on iphone11 Pro Max

I finished my flutter app, and i want to test it in ios device, so i used a mac laptop and i did all the installations but when i did the command "flutter run" i got this error
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install... 4,0s
CocoaPods' output:
↳
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
A flutter_barcode_scanner
A geolocator
A google_api_availability
A google_maps_flutter
A location
A location_permissions
A shared_preferences
A shared_preferences_macos
A shared_preferences_web
- Flutter
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `flutter_barcode_scanner` from `.symlinks/plugins/flutter_barcode_scanner/ios`
-> Fetching podspec for `geolocator` from `.symlinks/plugins/geolocator/ios`
-> Fetching podspec for `google_api_availability` from `.symlinks/plugins/google_api_availability/ios`
-> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
-> Fetching podspec for `location` from `.symlinks/plugins/location/ios`
-> Fetching podspec for `location_permissions` from `.symlinks/plugins/location_permissions/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
-> Fetching podspec for `shared_preferences_macos` from `.symlinks/plugins/shared_preferences_macos/ios`
-> Fetching podspec for `shared_preferences_web` from `.symlinks/plugins/shared_preferences_web/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "flutter_barcode_scanner":
In Podfile:
flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)
Specs satisfying the `flutter_barcode_scanner (from `.symlinks/plugins/flutter_barcode_scanner/ios`)` dependency were found, but they required a higher minimum deployment target.
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
Error running pod install
Error launching application on iPhone 11 Pro Max.
try this
rm ios/Podfile
flutter pub upgrade
flutter pub run
cd ios
pod init
pod update
flutter clean && flutter run
Flutter: Try this
Delete the Podfile, Podfile.lock, Pods folder, Runner.xcworkspace, Flutter.framwork(in ios/Flutter folder)
flutter clean
flutter build ios
For the m1 Mac I had a similar error for google mobile ads. The solution was that you have to download cocoa-pods from homebrew.
Follow The 2022 update: https://stackoverflow.com/a/65334677/16122154
The following works for me:
sudo arch -x86_64 gem install ffi
Trust me, I search for over 5 hours, tried every solution I cound find on internet. And only one work:
Delete the Podfile, Podfile.lock, Pods folder
flutter clean
cd ios
pod deintegrate ( this way pod will not reinstall the old libray )
cd ../
flutter run
Most of the solution don't include step 4, so that why even you clean and reinstall pod, it still behave the same.
If you are using Flutter, in your pubspec.yaml file make sure that your dependencies are installed below the cupertino icons line with correct indentation or it'll throw an error.
https://gorails.com/setup/osx/10.15-catalina
Make your day happy thanks buddy for the help...
MacOS catalina has permission issues on pre installed ruby and rails.
rbenv is best version control thing.
You need to install this tool by using terminal:
Open your terminal and type these commands:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And then run these commands:
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc
source ~/.zshrc
# Install Ruby
rbenv install 2.7.1
rbenv global 2.7.1
ruby -v
now install pods by going to your ios folder in flutter project
cd ios
pod install
That's it.

Cocoa pods install inside user directory(without sudo)

I can only access my directory, so I want to install the cocoa pods to the users directory. How can I achieve this?
I follow the below link but is not working.
Sudo-less installation
Please assist me how to achieve this.
I'll be very thankful if any one provide me step by step procedure to achieve this.
What I tried
gem install cocoapods --user-install
Error I'm getting
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:959:in `read': Permission denied - /Library/Ruby/Gems/2.0.0/specifications/terminal-notifier-1.6.0.gemspec (Errno::EACCES)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:959:in `load'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:644:in `block (2 levels) in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in `block in each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in `each_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:658:in `each_normal'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:669:in `_all'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:431:in `map'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:431:in `find_files'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:942:in `load_plugins'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:73: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/bin/gem:9:in `<main>'
Thanks in advance
I'm posting the steps which worked form me (In case any one need this).
I used Homebrew and bundler
Install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install brew-gem:
brew install brew-gem
Install bundler:
brew gem install bundler
bundler is a package management tool which provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.
Then add cocoapod in gemfile (if gemfile is missing then, use bundle init to create gemfile).
Then naviaged to your project directory and execute following command
bundle install --path vendor
The above command will look the gemfile and install the all the gems in the vendor directory.
Now onward prefix the bundle exe to add the cocoapod commands.
i.e
bundle exec pod install
bundle exec pod update

Cocoapods cannot load such file LoadError

I recently upgraded to Xcode 6.2 and OSX 10.10 and now adding a pod to my project doesn't work. I get the following 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 -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
I've tried all the fixes listed in this related question for Ruby 1.8 (Cocoapods No such file to load Error) and I'm still getting the same error.
I've also tried everything from this issue:
https://github.com/CocoaPods/CocoaPods/issues/2219
Things I've tried:
sudo gem uninstall xcodeproj
sudo gem uninstall cocoapods
sudo gem install xcodeproj
sudo gem install cocoapods
If I go to Xcode > Preferences > Locations > Command Line Tools: I only have an option for Xcode 6.2, so some places say to set this to Xcode 6.0, but I don't have this option.
Any help appreciated, thanks!
I had forgotten to add the following to the top of the podfile.
source 'https://github.com/CocoaPods/Specs.git'
In case someone else makes this oversight and comes across this page, hopefully this will be of help.

Resources