Fastlane step suddenly stopped working

We have a bunch of apps and all of those use fastlane, We have one that was building OK, but suddenly stopped working, We are getting this error in the fastlane step:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
/usr/local/bin/ruby -r ./siteconf20170418-2616-n3pwb0.rb extconf.rb
creating Makefile

current directory:
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make “DESTDIR=” clean

current directory:
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
} else if (klass == rb_cFixnum) {
^
generator.c:861:25: note: each undeclared identifier is reported only once for
each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
} else if (klass == rb_cBignum) {
^
generator.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-tautological-compare’
Makefile:241: recipe for target ‘generator.o’ failed
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/usr/local/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection.
Results logged to
/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/json-1.8.3/gem_make.out

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling.
Command failed, error: exit status 5
| |
±–±--------------------------------------------------------------±---------+
| x | fastlane (exit code: 1) | 16 sec |
±–±--------------------------------------------------------------±---------+
| Issue tracker: https://github.com/bitrise-io/steps-fastlane/issues |
| Source: https://github.com/bitrise-io/steps-fastlane |
±–±--------------------------------------------------------------±---------+

How can we fix this?

It seems you use a Gemfile to specify a fastlane version for the build.

The solution / in short:

Please upgrade the fastlane version in your Gemfile, run bundle update, commit the changes (including the Gemfile.lock change!) into your repo and push to git.

A bit more info: this error seems to be related to an older fastlane version which did not have proper support / was broken by Ruby 2.4 (quite a few Ruby tools were broken when Ruby 2.4 was released in December 2016).
We just updated the default Ruby version on our Linux/Android stack to 2.4 this weekend (Weekly Virtual Machine / Stack updates - 2017.04.15), so that’s the most likely cause of this issue. The current fastlane version should not have an issue with Ruby 2.4, so all you have to do is to upgrade the fastlane version (in your Gemfile and Gemfile.lock).

It is fixed. Thanks a lot!

1 Like