【问题标题】:Error installing, running Fastlane for Flutter on mac在 Mac 上安装、运行 Fastlane for Flutter 时出错
【发布时间】:2020-04-05 02:07:20
【问题描述】:

点击链接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 时,它给了我同样的上述错误

【问题讨论】:

  • 欢迎来到stackoverflow。确保在控制台输出中粘贴时使用代码块而不是块引用。以这种方式阅读要容易得多。更多here.
  • 有趣的是,我遇到了完全相同的问题。

标签: ruby macos flutter fastlane


【解决方案1】:

基于此线程(感谢@lwj 回答):

https://github.com/fastlane/fastlane/issues/15740

1- 可能需要先卸载 cask fastlane:

brew cask uninstall fastlane

2- 然后使用 RubyGems 安装它:

sudo gem install fastlane -NV

也是因为苹果把默认shell改成了zsh,参考@fdg13gustav 回答:https://stackoverflow.com/a/58310864/1995358

3- 在你的主目录中创建.zprofile 文件

关于这个线程: https://github.com/fastlane/fastlane/issues/12609

4- 将这些行添加到您的 ~/.zprofile 文件中:

export PATH="$HOME/.fastlane/bin:$PATH"
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

【讨论】:

    【解决方案2】:

    我找到了一个基于this issue on the fastlane GitHub repo 的“临时解决方法”来解决此问题。

    通过brew caskgem 安装fastlane 后,尝试运行以下命令:

    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
    

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

    【讨论】:

      猜你喜欢
      • 2020-05-31
      • 1970-01-01
      • 2013-12-24
      • 2021-10-13
      • 1970-01-01
      • 2022-12-30
      • 1970-01-01
      • 2015-02-12
      • 1970-01-01
      相关资源
      最近更新 更多