Tag Archives: ruby

pod install error: Oh no, an error occurred. (Ultimate Solution)

Project scenario:

There was an error in pod install recently

[!] Oh no, an error occurred.


Problem description


JSON::ParserError - 416: unexpected token at '"SharedTestUtilities/FIROptionsMock'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:748:in `from_string'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification.rb:722:in `from_file'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source.rb:188:in `specification'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:58:in `block in specification_name'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:56:in `each'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/specification/set.rb:56:in `specification_name'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/cdn_source.rb:216:in `search'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:385:in `find_cached_set'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:165:in `search_for'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `each'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_by'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_by!'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:60:in `block in sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:59:in `sort_dependencies'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Users/tiger/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Users/tiger/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/pod:23:in `load'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/pod:23:in `<main>'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/Users/tiger/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=416%3A+unexpected+token+at+%27%22SharedTestUtilities%2FFIROptionsMock%27&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new


Cause analysis:

In fact, after upgrading cocoapods, you need to clear it…


Solution:

Use this following command to clear the cache:

sudo rm -rf ~/.cocoapods/repos

How to fix the ERROR: Failed to build gem native extension in Centos 8

[root@DBAMAXWELL ~]# gem install mongo

Building native extensions. This could take a while...
ERROR:  Error installing mongo:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/share/gems/gems/bson-4.14.1/ext/bson
/usr/bin/ruby -r ./siteconf20220325-427526-vfnj46.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /usr/local/share/gems/gems/bson-4.14.1 for inspection.
Results logged to /usr/local/lib64/gems/ruby/bson-4.14.1/gem_make.out

 

Solution:
[root@DBAMAXWELL ~]# yum install ruby-devel

Last metadata expiration check: 1:48:48 ago on Fri 25 Mar 2022 05:54:43 PM CST.
Dependencies resolved.
===============================================================================================================================================================================================================
 Package                                     Architecture                            Version                                                                  Repository                                  Size
===============================================================================================================================================================================================================
Installing:
 ruby-devel                                  x86_64                                  2.5.9-109.module_el8.5.0+1097+b05a0601                                   appstream                                  126 k

Transaction Summary
===============================================================================================================================================================================================================
Install  1 Package

Total download size: 126 k
Installed size: 294 k
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64.rpm: Curl error (28): Timeout was reached for http://centosg9.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/ruby-devel-2.5.9-109.module_el8.5.0%2b1097%2bb05a0601.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64.rpm                                                                                                                   1.6 kB/s | 126 kB     01:17    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                          1.6 kB/s | 126 kB     01:18     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                       1/1 
  Installing       : ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64                                                                                                                              1/1 
  Running scriptlet: ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64                                                                                                                              1/1 
  Verifying        : ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64                                                                                                                              1/1 

Installed:
  ruby-devel-2.5.9-109.module_el8.5.0+1097+b05a0601.x86_64

Complete!

[root@DBAMAXWELL ~]# gem install mongo
Building native extensions. This could take a while…
Successfully installed bson-4.14.1
Fetching: mongo-2.17.0.gem (100%)
Successfully installed mongo-2.17.0
2 gems installed
[root@DBAMAXWELL ~]#

[Solved] New MAC Unity Develop Error: error installing cocoapods

The new MAC system is 11.4, and the installed Xcode version is 13.2.1
after opening a unity project and switching to IOS platform, cocoapods is installed in the background, but an error is reported indicating that the installation fails:

ERROR: Error installing cocoapods:
       ERROR: Failed to build gem native extension.
   current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Framewoks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220311-4106-wxounc.rb extconf.rb
   mkmf.rb can't find header files for ruby at /System/Library/Framewoks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development environment,ruby-dev or ruby-devel for example.

According to the error prompt and query from the network, it should be that a new Ruby Version needs to be installed, and the ruby provided by the system cannot be used
installing Ruby requires RVM, and installing RVM requires homebrew

Install homebrew

Use the command /usr/bin/Ruby - e" $(curl - fssl) is not used here https://raw.githubusercontent.com/Homebrew/install/master/install )"

After installation, execute brew update update.

Then execute brew -vto see the installed version

Install RVM

Install RVM curl -L https://get.rvm.io | bash -s stable

reload RVM environment source ~/.rvm/scripts/rvm

View RVM version RVM -v

Install Ruby

Check the known version of ruby RVM list known

check the installed version of ruby RVM list

Install a ruby version. I chose 2.6.5 RVM install 2.6.5

After installation, check the Ruby Version Ruby -v. If it is not the version just downloaded, I need to use the command to cut the version

Install cocoapods

After the above installation, execute sudo gem install cocoapods -n/usr/local/bin to install cocoapods
after the installation, execute pod --version to view the version of cocoapods

Here, for unit packaging, cocoapods are not completely installed. You need to continue to follow the following steps.

Command + Shift + G, open to the folderpop-up window, and enter ~/.cocoapods, after opening the cocoapods folder, delete all the contents under it, create a new repos folder, open the command line tool, and execute the following three commands in turn

1) cd ~/.cocoapods/repos
2) git clone --depth 1 https://github.com/CocoaPods/Specs.git master
3) pod repo update

In this way, the Xcode project exported by unity will have Xcworkspace file (in case of problems in cocoapods environment, the exported Xcode project only has .xcodeproj file, and there are many exceptions when using this file for packaging press conference), and then open the file with Xcode for subsequent publishing

[Solved] cocopod Error: failed: undefined method `map‘ for nil:NilClass

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command


/usr/local/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack


   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 11.3.1 (11C504)
         Git : git version 2.19.0
Ruby lib dir : /Users/huanghaipo/.rvm/rubies/ruby-2.6.3/lib
Repositories : HPSpecs - git - https://github.com/HuangHaiPo/HPSpecs.git @ 87ca8ef48b56269780abb0e14211ca1f2e121217
               HuModularizationSpecs - git - [email protected]:HuModularizationLibrary/HuModularizationSpecs.git @ cd28555226d424e50e8e7454c3a8a5b287e4b9f2
               master - git - https://github.com/CocoaPods/Specs.git @ 061335ab06da5c1f542cdb56bc0d73f9af2d1984




### Podfile

ruby
source 'https://github.com/CocoaPods/Specs.git'

# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
pe=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

Solution:

Execute the following command to update the local library. If the version is low, upgrade cocoapods

pod repo update
upgrade
sudo gem update --system
sudo gem install cocoapods
pod setup

[Solved] ERROR: While executing gem … (Gem::FilePermissionError)

Environment: MAC.

When learning rails, follow the official documents. Errors may be reported at this step

 gem install rails

ERROR: While executing gem … (Gem::FilePermissionError)

Even if sudo is used to force the installation, an error will be reported in the next step.

rails new blog

`auth_ data=’: couldn’t set additional authenticated data

Solution:

Installing Ruby under MacOS – 🎄 Adomikao Yu Yongjian

The reason for the error is that the MAC installs ruby in the/usr/bin directory by default. This directory has strict permissions, resulting in code execution failure. The solution is to use RVM to install ruby in the user directory without affecting the system environment.

Cocoapods Install ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.

Cocoapods installation failed

Complete error message trying to install my problem

Using alamofire needs to be based on cocoapods, but there are many problems in the process of trying to install cocoapods. It has failed for a long time. Finally, the installation is successful only after the on-demand broadcast of the leaders in the group. In fact, sometimes the solution to the problem is very simple. I hope this blog can help you.

Complete error reporting

yusael@air ~ % sudo gem install -n /usr/local/bin cocoapods
Fetching cocoapods-trunk-1.6.0.gem
Fetching cocoapods-search-1.0.1.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-try-1.2.0.gem
Fetching cocoapods-downloader-1.5.1.gem
Fetching cocoapods-deintegrate-1.0.5.gem
Successfully installed cocoapods-try-1.2.0
Successfully installed cocoapods-trunk-1.6.0
Successfully installed cocoapods-search-1.0.1
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.5.1
Successfully installed cocoapods-deintegrate-1.0.5
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20211110-79554-472vcj.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/gem_make.out

Try to install

Steps: first install homebrew, then update ruby, and then install cocoapods

Note: many online blogs require the installation of RVM, in fact, RVM does not have to be </ font>, but is just a way to update ruby

The blog of the boss is directly quoted here. The reference is as follows:

    1. Mac OS system install homebrew Mac OS system update Ruby Mac OS system restart cocoapods

My question

Generally speaking, the installation can be basically completed according to the above process. Here is my problem. My problem is that the version of ruby is too low. Before successful installation, my version is 2.6.3p62. I will update the ruby version to 3.0.2_ After 1, execute: sudo gem install - N/usr/local/bin cocoapods and the installation is successful!

The main problem here is that the latest ruby is updated through homebrew, but it is not necessarily the latest, so the installation fails.

(in fact, in the article of the boss cited above, it is written to configure the latest Ruby environment variables, but I didn’t read it carefully at the beginning)

Here are two ways to configure Ruby environment variables:

Method 1:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

Method 2:

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

Check whether the ruby version is updated through Ruby - V and try to install it later

Prompt IPA processing failed when exporting IOS adhoc

Prompt IPA processing failed when IOS adhoc

View the log of standard to view errors

View standard’s log

The log contains a large string of simulator information, so directly search the x86 keyword, and then check which framework is included, and then CD go in. Remember to enter the framework and remove i386 and x86_ 64

lipo -info xxxx

Remove command:

lipo -remove i386 xxxx -o xxxx
lipo -remove x86_64 xxxx -o xxxx

View errors

Before, I was misled by the Internet. I had to search all the "x86" keywords, and then search out Ruby (universal. X86_64) , thinking about viewing or updating with lipo , which wasted a lot of time and failed… Finally, homebrew
is also updated

Finally, I tried to search error , and found that framework was included in bundle of tent , and finally it was OK to remove it
IPA processing failed will be prompted when IOS ad hoc , the framework in tencetopen is attached with x86 , after removal, you can check the keywords of failed or error in your log.

Mon 08

03:00

06:00

09:00

12:00

03:00

06:00

09:00

Tue 09

Remove all SDK schemas

Update relevant environment

IOS tasks

IOS diagram functionality to mermaid

Follow up interest can be focused on the following column or official account number [Python2048].

"Android - the world of hackers"
"difficult and miscellaneous bugs - no language"


Author: Altman Superman dujinyang

Source: CSDN

Original text: https://dujinyang.blog.csdn.net/

Copyright notice: This is the original article of blogger Du Jinyang. Please attach the blog link for reprint!

When Jekyll runs, it will prompt an error. Cannot load such file — webrick (LoadError)

The complete error message is as follows:

LinkChecker: [Warning]
                    done in 13.838 seconds.
 Auto-regeneration: enabled for 'D:/WorkDir/Repository/GitHub/opensearch/documentation-website'
                    ------------------------------------------------
      Jekyll 4.2.1   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------
D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `require_relative'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `setup'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:100:in `process'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
        from D:/DKits/Ruby/bin/jekyll:23:in `load'
        from D:/DKits/Ruby/bin/jekyll:23:in `<main>'

Problems and Solutions

According to the official project description:

This is because:
webrick has not been bound to Ruby since Ruby 3.0. Please refer to the link:   Ruby 3.0.0 Released   Description in.

Webrick needs to be added manually.

The added commands are:

bundle add webrick

Then we can solve the problem.

When Jekyll runs, it will prompt an error. Cannot load such file — webrick (LoadError) – Open Source – ossez

Runtime error – [xcodeproj] unknown object version. [How to Solve]

Error during pod install:

### Error

“`
RuntimeError – [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:227:in `initialize_from_file’
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.15.0/lib/xcodeproj/project.rb:112:in `open’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1177:in `block (2 levels) in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `each’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1176:in `block in inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:1171:in `inspect_targets_to_integrate’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:410:in `analyze’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:234:in `resolve_dependencies’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:156:in `install!’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run’
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>’
/usr/local/bin/pod:23:in `load’
/usr/local/bin/pod:23:in `<main>’
“`

Reason: Xcode version and CocoaPods version do not match, need to update CocoaPods
Solution.
Enter the command in the terminal

gem install cocoapods --pre

Error Messages:

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

Plus permissions:

sudo gem install cocoapods --pre

Execute pod install again successfully!

RuntimeError – [Xcodeproj] Unknown object version.

After xcode13 is upgraded, if a new project is built, pod install will report an error, as shown in the figure:

Reason: This is because the local version of Xcode does not match the version of cocoapods. You need to update cocoapods
solution:

Refer to the solution provided on the Internet and input the command at the terminal  $ gem install cocoapods --pre  

Error will be reported:     You don’t have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

  Solution: input in the terminal     sudo gem install -n /usr/local/bin cocoapods –pre

It can be used normally in pod install

 

ERR Slot 3300 is already busy (Redis::CommandError)

Can I set the above configuration?(type 'yes' to accept): yes
/usr/local/share/gems/gems/redis-3.0.0/lib/redis/client.rb:79:in `call': ERR Slot 3300 is already busy (Redis::CommandError)
        from /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:2190:in `block in method_missing'
        from /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:36:in `block in synchronize'
        from /usr/share/ruby/monitor.rb:211:in `mon_synchronize'
        from /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:36:in `synchronize'
        from /usr/local/share/gems/gems/redis-3.0.0/lib/redis.rb:2189:in `method_missing'
        from ./redis-trib.rb:205:in `flush_node_config'
        from ./redis-trib.rb:657:in `block in flush_nodes_config'
        from ./redis-trib.rb:656:in `each'
        from ./redis-trib.rb:656:in `flush_nodes_config'
        from ./redis-trib.rb:997:in `create_cluster_cmd'
        from ./redis-trib.rb:1373:in `<main>'

It shows that the 3300 slot is occupied by multiple nodes. The landlord has solved it by using the following methods. Open each server, execute the flush hall, flush dB and cluster reset instructions, and then re create it successfully

Error in installing RPM: requires Ruby Version > = 2. ** [How to Solve]

 

3 error conditions

Upgrade Ruby

Download GPG public key

gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import
or
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import (My Choice)

Download RVM and set up environment

curl -L http://get.rvm.io | bash -s stable
source /usr/local/rvm/scripts/rvm

View existing Ruby versions

rvm list known

Upgrade to 2.4.0

rvm install 2.4.0

Install RPM again

gem install fpm