【发布时间】:2022-01-25 09:12:48
【问题描述】:
我正在为 Android 和 iOS 开发 Flutter 应用。该应用程序在 Android 模拟器上处于稳定的开发状态,所以我想我会尝试在 iOS 模拟器上运行它。 Macos 上的 Flutter 安装过程需要安装 Cocoapods。尝试使用Macos安装Ruby,遇到权限错误后,决定试试asdf,Ruby的最新版本(Ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21])和Cocoapods (1.11 .2)。安装似乎成功,但运行 pod 会导致以下错误:
加载插件时出错cocoapods-plugins-1.0.0。
NoMethodError - 未定义的方法 activate' for #<Gem::StubSpecification:0x00007f963819f4f8 @extension_dir=nil, @full_gem_path="/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0", @gem_dir=nil, @ignored=nil, @loaded_from="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/specifications/cocoapods-plugins-1.0.0.gemspec", @data=#<Gem::StubSpecification::StubLine:0x00007f9638194850 @name="cocoapods-plugins", @version=#<Gem::Version "1.0.0">, @platform="ruby", @extensions=[], @full_name="cocoapods-plugins-1.0.0", @require_paths=["lib"]>, @name=nil, @spec=#<Gem::Specification:0x00007f96381cc278 @extension_dir=nil, @full_gem_path="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0", @gem_dir=nil, @ignored=nil, @bin_dir=nil, @cache_dir=nil, @cache_file=nil, @doc_dir=nil, @ri_dir=nil, @spec_dir=nil, @spec_file=nil, @gems_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems", @base_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0", @loaded=true, @activated=true, @loaded_from="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/specifications/cocoapods-plugins-1.0.0.gemspec", @original_platform=nil, @installed_by_version=#<Gem::Version "3.3.2">, @autorequire=nil, @date=2016-05-10 00:00:00 UTC, @description=" This CocoaPods plugin shows information about all available CocoaPods plugins\n (yes, this is very meta!).\n This CP plugin adds the \"pod plugins\" command to CocoaPods so that you can list\n all plugins (registered in the reference JSON hosted at CocoaPods/cocoapods-plugins)\n", @email=nil, @homepage="https://github.com/cocoapods/cocoapods-plugins", @name="cocoapods-plugins", @post_install_message=nil, @signing_key=nil, @summary="CocoaPods plugin which shows info about available CocoaPods plugins.", @version=#<Gem::Version "1.0.0">, @authors=["David Grandinetti", "Olivier Halligon"], @bindir="bin", @cert_chain=[], @dependencies=[<Gem::Dependency type=:runtime name="nap" requirements=">= 0">, <Gem::Dependency type=:development name="bundler" requirements="~> 1.3">, <Gem::Dependency type=:development name="rake" requirements=">= 0">], @executables=[], @extensions=[], @extra_rdoc_files=[], @files=[], @licenses=["MIT"], @metadata={}, @platform="ruby", @rdoc_options=[], @require_paths=["lib"], @required_ruby_version=#<Gem::Requirement:0x00007f96381d7b28 @requirements=[[">=", #<Gem::Version "2.0.0">]]>, @required_rubygems_version=#<Gem::Requirement:0x00007f96381d7ee8 @requirements=[[">=", #<Gem::Version "0">]]>, @requirements=[], @rubygems_version="3.3.2", @specification_version=4, @test_files=[], @new_platform="ruby", @full_name="cocoapods-plugins-1.0.0", @full_require_paths=["/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-plugins-1.0.0/lib"] cocoapods-plugins-1.0.0>, @base_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0", @gems_dir="/Users/kevin/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems", @default_gem=false, @activated=true> Did you mean? activated? /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:93:in safe_activate_and_require'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:31:in block in load_plugins' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in 地图'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command/plugin_manager.rb:30:in load_plugins' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:326:in 阻止运行'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:325:in each' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/claide-1.0.3/lib/claide/command.rb:325:in run'
/Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in run' /Users/xyz/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/cocoapods-1.11.2/bin/pod:55:in load' /Users/xyz/.asdf/installs/ruby/3.0.3/bin/pod:25:in '
我不需要修复。我只想知道兼容的 Ruby 和 Cocoapods 版本,并允许我在 Macos 上开发我的 Flutter 应用程序取得进展。
【问题讨论】:
标签: ruby flutter macos cocoapods