fastlane / fastlane

šŸš€ The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.56k stars 5.71k forks source link

bundle install fails when installing digest-crc on 2.150.0.rc2 onwards (incl. 2.150.0 official release) #16725

Closed rogerluan closed 4 years ago

rogerluan commented 4 years ago

New Release Candidate Issue Checklist

Issue Information

Issue Description

I can't update fastlane to the latest version. I'm using rbenv, and on Ruby 2.6.5 it throws this error:

Error thrown on Ruby 2.6.5

``` Fetching digest-crc 0.6.0 (was 0.5.1) Installing digest-crc 0.6.0 (was 0.5.1) with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.6.0/gems/digest-crc-0.6.0/ext/digest rake RUBYARCHDIR\=/Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0/digest-crc-0.6.0 RUBYLIBDIR\=/Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0/digest-crc-0.6.0 rbenv: rake: command not found The `rake' command exists in these Ruby versions: 2.7.0 rake failed, exit code 127 Gem files will remain installed in /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.6.0/gems/digest-crc-0.6.0 for inspection. Results logged to /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0/digest-crc-0.6.0/gem_make.out An error occurred while installing digest-crc (0.6.0), and Bundler cannot continue. Make sure that `gem install digest-crc -v '0.6.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: fastlane was resolved to 2.150.0, which depends on google-cloud-storage was resolved to 1.26.2, which depends on digest-crc ```

Error thrown on Ruby 2.7.0

``` Fetching digest-crc 0.6.0 (was 0.5.1) Installing digest-crc 0.6.0 (was 0.5.1) with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.7.0/gems/digest-crc-0.6.0/ext/digest rake RUBYARCHDIR\=/Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/digest-crc-0.6.0 RUBYLIBDIR\=/Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/digest-crc-0.6.0 /Users/rogerluan/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException) from /Users/rogerluan/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path' from /Users/rogerluan/.rbenv/versions/2.7.0/bin/rake:23:in `

' rake failed, exit code 1 Gem files will remain installed in /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.7.0/gems/digest-crc-0.6.0 for inspection. Results logged to /Users/rogerluan/Documents/Projects/tellus-ios/.vendor/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/digest-crc-0.6.0/gem_make.out An error occurred while installing digest-crc (0.6.0), and Bundler cannot continue. Make sure that `gem install digest-crc -v '0.6.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: fastlane was resolved to 2.150.0, which depends on google-cloud-storage was resolved to 1.26.2, which depends on digest-crc ```

And when I try installing 2.150.0 rc1, it works, but with digest-crc 0.5.1 (which got upgraded on the latest release I assume). I tried installing every version in rc1 ~ rc7, including the the final latest version, deleting my bundle's ruby gems between each install, and only rc1 succeeds.

Environment

I use rbenv I tried on ruby 2.6.5 and ruby 2.7.0, and they output different errors. I couldn't find in the docs which ruby version I'm supposed to use (although the last working version is rc1 which I ran on Ruby 2.6.5) macOS catalina

Mentioning

cc: @joshdholtz

fastlane-bot commented 4 years ago

It seems like you have not included the output of fastlane env To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env :+1:

rogerluan commented 4 years ago

Please ignore ā˜ļø I can't run fastlane env šŸ˜… Happy to run any other command line that might help debug this tho, just ping me :)

kishikawakatsumi commented 4 years ago

I have the same problem. The workaround I found is add gem rake to the Gemfile.

# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "fastlane"
gem "versionomy"
gem "rake" # <= Add this line
rogerluan commented 4 years ago

I have the same problem. The workaround I found is add gem rake to the Gemfile.

# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "fastlane"
gem "versionomy"
gem "rake" # <= Add this line

This works, thanks! šŸ’Ŗ

Not sure what's the definitive fix here though, maybe either fastlane or google-cloud-storage needs to add rake as a dependency? šŸ¤”

kishikawakatsumi commented 4 years ago

I haven't looked into the details, but the error message indicates that Gem::GemNotFoundException.

Installing digest-crc 0.6.0 (was 0.5.1) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/katsumi/work/Yappli/app-factory/vendor/bundle/ruby/2.7.0/gems/digest-crc-0.6.0/ext/digest
rake RUBYARCHDIR\=/Users/katsumi/work/Yappli/app-factory/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/digest-crc-0.6.0
RUBYLIBDIR\=/Users/katsumi/work/Yappli/app-factory/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/digest-crc-0.6.0
/Users/katsumi/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake
(Gem::GemNotFoundException)
    from /Users/katsumi/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
    from /Users/katsumi/.rbenv/versions/2.7.0/bin/rake:23:in `<main>'

rake failed, exit code 1
rlindner commented 4 years ago

See https://github.com/postmodern/digest-crc/issues/18

expilu commented 4 years ago

I think the problem might be in the gem digest-crc version 0.6.0, which was published today

rogerluan commented 4 years ago

I attempted to fix it here https://github.com/postmodern/digest-crc/pull/20 let's see

rogerluan commented 4 years ago

https://github.com/postmodern/digest-crc/pull/20 got merged and released in https://github.com/postmodern/digest-crc/releases/tag/v0.6.1

I tested installing latest version of fastlane without explicitly declaring rake as a dependency, and this issue has been fixed.

šŸš€

joshdholtz commented 4 years ago

@rogerluan Perfect! Thank you ā¤ļø

iur-kaia commented 4 years ago

Sorry to revive an old thread. I am running fastlane 2.154.0 on CircleCI and have the same issue with digest-crc 0.6.1. I have also tried to add Rake as an explicit dependency, it didn't help. Any ideas?

#!/bin/bash --login -eo pipefail
bundle install --path .bundle
Fetching gem metadata from https://rubygems.org/........
Fetching rake 13.0.1
Installing rake 13.0.1
Fetching CFPropertyList 3.0.2
Installing CFPropertyList 3.0.2
Fetching public_suffix 4.0.5
Installing public_suffix 4.0.5
Fetching addressable 2.7.0
Installing addressable 2.7.0
Fetching atomos 0.1.3
Installing atomos 0.1.3
Fetching aws-eventstream 1.1.0
Installing aws-eventstream 1.1.0
Fetching aws-partitions 1.351.0
Installing aws-partitions 1.351.0
Fetching aws-sigv4 1.2.1
Installing aws-sigv4 1.2.1
Fetching jmespath 1.4.0
Installing jmespath 1.4.0
Fetching aws-sdk-core 3.104.3
Installing aws-sdk-core 3.104.3
Fetching aws-sdk-kms 1.36.0
Installing aws-sdk-kms 1.36.0
Fetching aws-sdk-s3 1.75.0
Installing aws-sdk-s3 1.75.0
Fetching babosa 1.0.3
Installing babosa 1.0.3
Using bundler 2.1.4
Fetching claide 1.0.3
Installing claide 1.0.3
Fetching colored 1.2
Installing colored 1.2
Fetching colored2 3.1.2
Installing colored2 3.1.2
Fetching highline 1.7.10
Installing highline 1.7.10
Fetching commander-fastlane 4.4.6
Installing commander-fastlane 4.4.6
Fetching declarative 0.0.20
Installing declarative 0.0.20
Fetching declarative-option 0.1.0
Installing declarative-option 0.1.0
Fetching digest-crc 0.6.1
Installing digest-crc 0.6.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1/ext/digest
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -rrubygems
/Users/distiller/project/.bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake
RUBYARCHDIR\=/Users/distiller/project/.bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/digest-crc-0.6.1
RUBYLIBDIR\=/Users/distiller/project/.bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/digest-crc-0.6.1
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -S
extconf.rb
checking for stdint.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)
/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:3:in `<main>'
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1/ext/digest/Rakefile:32:in
`block (3 levels) in <top (required)>'
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1/ext/digest/Rakefile:31:in
`chdir'
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1/ext/digest/Rakefile:31:in
`block (2 levels) in <top (required)>'
/Users/distiller/project/.bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in
`<main>'
Tasks: TOP => default => crc16_genibus/crc16_genibus_ext.bundle =>
crc16_genibus/Makefile
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1 for
inspection.
Results logged to
/Users/distiller/project/.bundle/ruby/2.6.0/extensions/universal-darwin-19/2.6.0/digest-crc-0.6.1/gem_make.out

An error occurred while installing digest-crc (0.6.1), and Bundler
cannot continue.
Make sure that `gem install digest-crc -v '0.6.1' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  fastlane was resolved to 2.154.0, which depends on
    google-cloud-storage was resolved to 1.27.0, which depends on
      digest-crc

Exited with code exit status 5
rogerluan commented 4 years ago

Try bundle update (not bundle update fastlane) to make sure all gems are updated simultaneously. There's often interdependencies that can't be simultaneously satisfied when updating just fastlane alone, unfortunately.

Let me know how that goes @iur-kaia

iur-kaia commented 4 years ago

@rogerluan thank you for your response.

I've tried to do bundle update instead of bundle update fastlane and it had the same results for dependencies (probably because I have only fastlane in bundle). At this point I am thinking about CircleCI image issues.

If that helps I am running it on this (Xcode12 beta 3) image https://circle-macos-docs.s3.amazonaws.com/image-manifest/v3358/index.html on CircleCI. I think it actually works fine with the same fastlane version on Xcode 11.6 image.

joshdholtz commented 4 years ago

It looks like this may be a CircleCI issue with that image with development tools not being installed šŸ¤”

/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.
iur-kaia commented 4 years ago

@joshdholtz yeah, looks like that. I've posted this on CircleCI forums, maybe someone there can help.

iur-kaia commented 4 years ago

@rogerluan @joshdholtz thank you again for your input. The issue was as you've guessed with CircleCI image of Xcode 12 beta. For some reason the native Ruby on that image produces this problem. If you change the ruby version to 2.7 on that image you don't have this issue. For reference: https://discuss.circleci.com/t/xcode-12-beta-4-released/36956/8

rogerluan commented 2 years ago

Thank you for your last message @iur-kaia . I faced this issue again when installing fastlane on Jenkins, and the solution was in fact to update Ruby (from 2.6.5 to 2.7.5, which is the latest v2 version as of now). I spent some good amount of time on this before upgrading Ruby and couldn't figure out why this error is thrown šŸ˜ž For SEO purposes and future reference, here's the error I was facing, that got fixed by upgrading Ruby:

Using danger-plugin-api 1.0.0
Fetching danger-swiftlint 0.29.4
Using faraday-cookie_jar 0.0.7
Using google-cloud-env 1.5.0
Using danger-swiftformat 0.8.1
Using google-cloud-core 1.6.0
Installing danger-swiftlint 0.29.4 with native extensions
Installing digest-crc 0.6.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/redacted/.jenkins/workspace/redacted/.vendor/ruby/2.6.0/gems/danger-swiftlint-0.29.4/ext/swiftlint
/Users/redacted/.rbenv/versions/2.6.5/bin/ruby -I/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0
-rrubygems /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rake-13.0.6/exe/rake
RUBYARCHDIR\=/Users/redacted/.jenkins/workspace/redacted/.vendor/ruby/2.6.0/extensions/x86_64-darwin-21/2.6.0/danger-swiftlint-0.29.4
RUBYLIBDIR\=/Users/redacted/.jenkins/workspace/redacted/.vendor/ruby/2.6.0/extensions/x86_64-darwin-21/2.6.0/danger-swiftlint-0.29.4
/Users/redacted/.rbenv/versions/2.6.5/bin/ruby: No such file or directory --
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rake-13.0.6/exe/rake (LoadError)

rake failed, exit code 1

Gem files will remain installed in
/Users/redacted/.jenkins/workspace/redacted/.vendor/ruby/2.6.0/gems/danger-swiftlint-0.29.4 for inspection.
Results logged to
/Users/redacted/.jenkins/workspace/redacted/.vendor/ruby/2.6.0/extensions/x86_64-darwin-21/2.6.0/danger-swiftlint-0.29.4/gem_make.out

  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/builder.rb:93:in `run'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/rake_builder.rb:28:in `build'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/builder.rb:159:in `build_extension'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/builder.rb:193:in `block in
build_extensions'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/builder.rb:190:in `each'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/ext/builder.rb:190:in `build_extensions'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/installer.rb:845:in `build_extensions'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/source/rubygems.rb:200:in `install'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/installer/gem_installer.rb:54:in `install'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/installer/parallel_installer.rb:177:in `block
in worker_pool'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/worker.rb:62:in `apply_func'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/worker.rb:57:in `block in process_queue'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/worker.rb:54:in `loop'
  /Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/worker.rb:54:in `process_queue'
/Users/redacted/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/worker.rb:91:in `block (2 levels) in
create_threads'

An error occurred while installing danger-swiftlint (0.29.4), and Bundler cannot continue.

In Gemfile:
  danger-swiftlint

Things I tried before deciding to upgrade Ruby:

  1. Remove gem danger-swiftlint (which then error'd on fastlane);
  2. Add gem 'rake' explicit dependency on the Gemfile;
  3. Deleted & reinstalled Xcode's Command Line Tools;
  4. Deleted bundler and rubygems and re-installed with ri documentation;
  5. Probably other things I can't remember right now šŸ˜…

Thanks again @iur-kaia ! šŸ’Ŗ