Cocoapods: LoadError - cannot load such file -- macho

Created on 19 Jun 2018  路  8Comments  路  Source: CocoaPods/CocoaPods

Upgraded from CocoaPods 1.3.1 to 1.5.3

Using Xcode 9.2

Issue with pod install

Report

What did you do?

Run pod install

What did you expect to happen?

Install all pod dependencies correctly.

What happened instead?

Error

LoadError - cannot load such file -- macho
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:432:in `rescue in dynamic_binary?'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:427:in `dynamic_binary?'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:164:in `block in vendored_dynamic_frameworks'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:163:in `select'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:163:in `vendored_dynamic_frameworks'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:172:in `vendored_static_frameworks'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:238:in `vendored_static_artifacts'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:56:in `block in generate'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:56:in `each'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:56:in `any?'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:56:in `generate'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:39:in `save_as'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb:107:in `update_changed_file'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:96:in `block in create_xcconfig_file'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `each'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `create_xcconfig_file'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:18:in `block in install!'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:142:in `message'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:14:in `install!'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:181:in `block (2 levels) in install_libraries'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `each'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `block in install_libraries'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:142:in `message'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:167:in `install_libraries'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:65:in `generate!'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:184:in `block in generate_pods_project'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:183:in `generate_pods_project'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:119:in `install!'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/bin/pod:23:in `load'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/bin/pod:23:in `<main>'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

## CocoaPods Environment

pod env

### Stack

CocoaPods : 1.5.3
Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
RubyGems : 2.5.0
Host : Mac OS X 10.12.6 (16G1408)
Xcode : 9.2 (9C40b)
Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /Users/kdanielwong/.rvm/rubies/ruby-2.1.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 0394a8486df6a54691151f75289676af4c7237d5

### Installation Source

Executable Path: /Users/kdanielwong/.rvm/gems/ruby-2.1.1/bin/pod

### Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.3.0
cocoapods-try : 1.1.0
```

Podfile

```ruby
platform :ios, '9.0'

target 'IGapp' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!

# Pods for IGapp
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'AFNetworking', '~> 3.0'
pod 'SDWebImage', '~> 4.0'
pod 'TOCropViewController'

target 'IGappTests' do
inherit! :search_paths
# Pods for testing
end

target 'IGappUITests' do
inherit! :search_paths
# Pods for testing
end

end

I've tried uninstalling and installing ruby macho, but it doesn't help.

gem which macho
/Users/kdanielwong/.rvm/gems/ruby-2.1.1/gems/ruby-macho-1.2.0/lib/macho.rb

Most helpful comment

@yanchaoGan " gem uninstall ruby-macho ", it works for me, too.

All 8 comments

This mostly seems a configuration issue. Interesting to see that you installed the gem but it still does not work.

I am uncertain from here. I think it is best to ask this question in StackOverflow under cocoapods tag instead.

@auspicious99 I am going to preemptively close this as we get many issues. At least right now this does not appear to be an actual issue with CocoaPods. Seems like a setup issue to install and use macho gem.

I will re-open this if we can figure out there is a change we can do in CocoaPods. For now please re-direct this question to StackOverflow.

I am getting this error trying to run 1.6.0 beta also. Same stack. I have a vendored static framework.

We switched to using require instead of autoload in https://github.com/CocoaPods/CocoaPods/pull/7980 based on feedback from other users, but really not sure what else we can do

the issue same to me. but i do " gem uninstall ruby-macho ", in the link below. it works for me

https://stackoverflow.com/questions/50970300/cocoa-pods-update-broke-something-now-pod-update-produces-errors/51066121#51066121

@dnkoutso

@yanchaoGan " gem uninstall ruby-macho ", it works for me, too.

ruby's DEPs system is horrible

@yanchaoGan " gem uninstall ruby-macho ", it works for me, too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steffendsommer picture steffendsommer  路  3Comments

intelliot picture intelliot  路  3Comments

evermeer picture evermeer  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

hmistry picture hmistry  路  3Comments