安装错误,在Mac上为Flutter运行Fastlane

问题描述 投票:2回答:1

跟随链接Flutter Fastlane docs

运行命令:

brew cask install fastlane

返回:

Gems updated: slack-notifier atomos claide nanaimo xcodeproj rouge xcpretty terminal-notifier tty-screen tty-cursor tty-spinner commander-fastlane faraday faraday_middleware gh_inspector mini_magick rubyzip naturally simctl jwt memoist signet
Gems already up-to-date: fastlane
**ERROR:  Error installing fastlane:
    signet requires Ruby version >= 2.4.0.**
Cleaning up installed gems...
Attempting to uninstall xcpretty-0.2.6
Successfully uninstalled xcpretty-0.2.6
Attempting to uninstall xcodeproj-1.4.4
Successfully uninstalled xcodeproj-1.4.4
Attempting to uninstall rubyzip-1.2.1
Successfully uninstalled rubyzip-1.2.1
Attempting to uninstall nanaimo-0.2.3
Successfully uninstalled nanaimo-0.2.3
Attempting to uninstall memoist-0.15.0
Successfully uninstalled memoist-0.15.0
Attempting to uninstall gh_inspector-1.0.3
Successfully uninstalled gh_inspector-1.0.3
Attempting to uninstall faraday_middleware-0.11.0.1
Successfully uninstalled faraday_middleware-0.11.0.1
Attempting to uninstall faraday-0.12.1
Successfully uninstalled faraday-0.12.1
Attempting to uninstall commander-fastlane-4.4.4
Successfully uninstalled commander-fastlane-4.4.4
Attempting to uninstall claide-1.0.1
Successfully uninstalled claide-1.0.1
Attempting to uninstall rouge-1.11.1
Successfully uninstalled rouge-1.11.1
Clean Up Complete
Detected shell config file at path '~/.bash_profile'
Please add the following line to your bash profile:
export PATH="$HOME/.fastlane/bin:$PATH"
**After doing so close the terminal session and restart it to start using fastlane 🚀
🍺  fastlane was successfully installed!**

给出了此输出。但是当我运行ruby -v

ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin16]

我得到这个输出。我在.bash_profile中添加了所有路径,然后在android /文件夹或任何给我此错误的地方运行fastlane envfastlane init

/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday/error.rb:95:in  <.module:Faraday>: superclass mismatch for class ConnectionFailed (TypeError)
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday/error.rb:6:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:80:in  'block in require_libs'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:79:in  'each'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:79:in  'require_libs'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:242:in  '<.module:Faraday>'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.17.1/lib/faraday.rb:16:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/spaceship/lib/spaceship/client.rb:1:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/spaceship/lib/spaceship.rb:3:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/setup/setup_ios.rb:1:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/setup/setup.rb:57:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane.rb:10:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in  'require'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/fastlane/lib/fastlane/cli_tools_distributor.rb:18:in  'take_off'
        from  /.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.28.3/bin/fastlane:20:in  '<.top (required)>'
        from  /.fastlane/bin/bundle/bin/fastlane:22:in  'load'
        from  /.fastlane/bin/bundle/bin/fastlane:22:in  '<.main>'

尝试sudo gem install fastlane后说

Successfully installed fastlane-2.137.0
Parsing documentation for fastlane-2.137.0
Done installing documentation for fastlane after 6 seconds
1 gem installed

但是当我再次写fastlane envfastlane init时,也给了我同样的错误

ruby macos flutter fastlane
1个回答
0
投票

我发现了一个“临时替代方法”来根据this issue on the fastlane GitHub repo解决此问题。

通过fastlanebrew cask安装gem后,尝试运行以下命令:

rm -rf $HOME/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/faraday-0.* 
rm -rf $HOME/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/specifications/faraday-0.* 
gem install faraday -v 0.17.0 --install-dir $HOME/.fastlane/bin/bundle/lib/ruby/gems/2.2.0

到目前为止,这已经为我解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.