当我在macOS Big Sur 11.2.3上运行此命令时:
pod setup
显示此错误:
$ pod setup ‹ruby-2.7.2›
Traceback (most recent call last):
12: from /Users/dolphin/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:22:in `<main>'
11: from /Users/dolphin/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:22:in `eval'
10: from /Users/dolphin/.rvm/gems/ruby-2.7.2/bin/pod:23:in `<main>'
9: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems.rb:304:in `activate_bin_path'
8: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems.rb:304:in `synchronize'
7: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems.rb:306:in `block in activate_bin_path'
6: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems.rb:243:in `finish_resolve'
5: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:435:in `resolve_current'
4: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:435:in `new'
3: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/resolver/set.rb:24:in `initialize'
2: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:42:in `require'
1: from /Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:in `gem'
/Users/dolphin/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:in `synchronize': deadlock; recursive locking (ThreadError)
(base)
我从互联网上搜索,但没有找到一些有用的信息,这个问题。我已经尝试重新安装cocoapods
仍然没有解决这个问题。我应该做什么来解决这个问题?这是我的ruby env:
~/source/cruise-open on main ⌚ 13:37:15
$ rvm list ‹ruby-2.7.2›
=* ruby-2.7.2 [ x86_64 ]
ruby-3.0.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base)
现在我发现运行pod install
命令仍然显示此错误。
2条答案
按热度按时间q35jwt9p1#
更新RubyGems对我来说很有用。
https://guides.rubygems.org/command-reference/#gem-update
gem update --system
7eumitmz2#
这个错误一定是针对任何rails应用程序的。检查Gemfile中的ruby和rails版本。在我的例子中,ruby是3.1.2,rails是7.0.4。
重新安装或再次安装依赖项。Ruby 3.1.2已经在我的系统中,但我重新安装了以修复此问题。
从/.rvm/gems/ruby-3.1.2/cache中删除捆绑器rm -rf捆绑器-2.3.25.gem我的宝石文件.lock与2.3.25捆绑在一起并从/.rvm/gems中删除ruby rm -rf ruby-3.1.2
现在,当您安装rails或捆绑到某个无效的gem时,错误将被更改:软件包已损坏,验证时出现异常:/Users/anjanasingh/.rvm/gems/ruby-3.1.2/cache/concurrent-ruby-1.1.10.gem中的参数数目错误(给定2个,应为1个)(参数错误)
现在,使用rvm卸载ruby(是的,rvm在我的情况下工作,尽管我使用rbenv设置ruby版本)
安装Ruby
捆绑应用程序
Rails仍然不存在。因此,安装Rails
我已经尝试了“rbenv安装3. 1. 2”和重新安装,安装enter image description here多次,但它不工作与rbenv。最后rvm工作。