I tried with versions 1.5.0 and 1.5.3 and got this error for both versions.
/Users/xxxx/xxxx/.gems/bin/pod install
tried to run pod install
Pods get installed
I got the following error
CocoaPods : 1.5.3
Ruby : ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin17]
RubyGems : 2.4.5.1
Host : Mac OS X 10.13.4 (17E199)
Xcode : 9.4 (9F1027a)
Git : git version 2.17.1
Ruby lib dir : /Users/xxxx/.rbenv/versions/2.2.4/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 44b861022b9f0c4ba03a664bbfa04ed4628bf2b7
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
LoadError - cannot load such file -- macho
/Users/xxxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:432:in `rescue in dynamic_binary?'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:427:in `dynamic_binary?'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:164:in `block in vendored_dynamic_frameworks'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:163:in `select'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:163:in `vendored_dynamic_frameworks'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/sandbox/file_accessor.rb:172:in `vendored_static_frameworks'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:122:in `add_static_dependency_build_settings'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:89:in `block in add_settings_for_file_accessors_of_target'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:86:in `each'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:86:in `add_settings_for_file_accessors_of_target'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:424:in `block in generate_vendored_build_settings'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:422:in `each'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb:422:in `generate_vendored_build_settings'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:79:in `generate'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:39:in `save_as'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb:107:in `update_changed_file'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:96:in `block in create_xcconfig_file'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `each'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `create_xcconfig_file'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:18:in `block in install!'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:142:in `message'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:14:in `install!'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:181:in `block (2 levels) in install_libraries'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `each'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `block in install_libraries'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:142:in `message'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:167:in `install_libraries'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:65:in `generate!'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:184:in `block in generate_pods_project'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:183:in `generate_pods_project'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:119:in `install!'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Users/xxx/code/AppboyKit/.gems/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Users/xxx/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/Users/xxx/xxx/.gems/bin/pod:23:in `load'
/Users/xxx/xxx/.gems/bin/pod:23:in `<main>'
@chshapiro thanks for the report.
Please see https://github.com/CocoaPods/CocoaPods/issues/7864 and https://github.com/CocoaPods/CocoaPods/issues/7849
I am going to close as a dup. Should try gem install ruby-macho
and also try to update your Ruby version.
Going to close as a dup. I will re-open if we figure out this is a CocoaPods issue.
@dnkoutso
I tried gem install ruby-macho
and it didn't work.
A few people have reported this over the last few days - maybe it should be looked into a little more.
It has been looked. I personally cannot reproduce and further more our CI is green. I would imagine it would have a ton of other requests here which leads me to believe that something is wrong with configuration.
I'd be glad to re-open this but it will most likely close out again out of inactivity.
@chshapiro I am going to re-open and see if anyone can help figure this out and narrow it down for others.
Sorry for the quick close.
I'm the poster of #7849.
Perhaps it has something to do with the way 1.5.3 uses macho? I'm not a ruby guy, and my main use of gem is for cocoa pods. So I've never, to my knowledge, messed up something to do with the macho config on this mac. Anyway, as you suggested in #7849, I've posted on stack overflow, here: https://stackoverflow.com/questions/50970300/cocoa-pods-update-broke-something-now-pod-update-produces-errors and so far nobody has answered.
TBH, I'm not familiar with ruby so this may be a terrible solution, but what worked for me is opening up the file in the top of the stacktrace (file_accessor.rb) and changing the top line from: autoload :MachO, 'macho'
to require 'macho'
. Could it have something to do with autoload being deprecated? Anyway, I hope that's helpful to someone.
That worked for me too thanks!
Worked for me too, thanks!
Thanks! I worked for me too!
Thanks! Worked for me
Thanks a lot ! Worked for me
Thanks! It worked for me too
if you're using iTerm -
brew cask install iterm2
you can just hold the cmd button down and click the link to open in editor. (then as above - change autoload :MachO, 'macho' to require 'macho')
@dnkoutso I came across this issue too.
For me, it happens when I'm not using a Gemfile
and I am also using RVM
. Simply using a Gemfile
, and bundle exec pod install
fixes the issue for me, without any code changes.
I'm not an expert in Ruby, but I found a way to easily reproduce it and posted it below. It just seems like autoload
is simply not working.
new-host:PopcornTimeTV ktran$ irb
2.1.1 :001 > autoload :MachO, 'macho'
=> nil
2.1.1 :002 > MachO.open("")
LoadError: cannot load such file -- macho
from (irb):2
from /Users/ktran/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'
2.1.1 :003 > puts $LOAD_PATH
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/x86_64-darwin12.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0/x86_64-darwin12.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-darwin12.0
=> nil
2.1.1 :004 > require("macho")
=> true
2.1.1 :005 > puts $LOAD_PATH
/Users/ktran/.rvm/gems/ruby-2.1.1/gems/ruby-macho-2.0.0/lib
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/x86_64-darwin12.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0/x86_64-darwin12.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0
/Users/ktran/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-darwin12.0
=> nil
2.1.1 :006 > MachO.open("")
ArgumentError: : no such file
from /Users/ktran/.rvm/gems/ruby-2.1.1/gems/ruby-macho-2.0.0/lib/macho.rb:25:in `open'
from (irb):6
from /Users/ktran/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'
2.1.1 :007 >
Seems like this is coming up often enough that it's worth using require
instead
I also just switched to a more recent version of rbenv
and it worked for me.
1. cd /Users/userName/.rvm/gems/ruby-2.2.4/gems/cocoapods-xxx/lib/cocoapods/sandbox
2. open file_accessor.rb
3. Autoload: MachO, 'macho' **replace** require 'macho'
- cd /Users/userName/.rvm/gems/ruby-2.2.4/gems/cocoapods-xxx/lib/cocoapods/sandbox 2. open file_accessor.rb 3. Autoload: MachO, 'macho' replace require 'macho'
Thanks, It worked for me.
Thanks! It worked for me too
Thanks! It worked for me too
Thanks! It worked for me .
Most helpful comment
TBH, I'm not familiar with ruby so this may be a terrible solution, but what worked for me is opening up the file in the top of the stacktrace (file_accessor.rb) and changing the top line from:
autoload :MachO, 'macho'
torequire 'macho'
. Could it have something to do with autoload being deprecated? Anyway, I hope that's helpful to someone.