When using Fastlane to define an action that uses assertthat-bdd gem to upload reports, I noticed that Fastlane version was resolving to 1.9.2. It was a problem because that version is using an older JSON gem and this causes AssertThatBDD::Report.upload to crash with the following output:
/Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/json-1.8.6/lib/json/common.rb:155:in `initialize': \e[31m[!] wrong number of arguments (given 2, expected 1)\e[0m (ArgumentError)
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/json-1.8.6/lib/json/common.rb:155:in `new'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/assertthat-bdd-1.6.3/lib/assertthat-bdd.rb:82:in `block in upload'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/assertthat-bdd-1.6.3/lib/assertthat-bdd.rb:53:in `each'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/assertthat-bdd-1.6.3/lib/assertthat-bdd.rb:53:in `upload'
from /Users/user/project/fastlane/actions/upload_bdd_reports.rb:10:in `run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:177:in `block (2 levels) in execute_action'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:162:in `block in execute_action'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:161:in `chdir'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:161:in `execute_action'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:109:in `trigger_action_by_name'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/fast_file.rb:140:in `method_missing'
from Fastfile:54:in `block (2 levels) in parsing_binding'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/lane.rb:33:in `call'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:50:in `block in execute'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:46:in `chdir'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/runner.rb:46:in `execute'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/command_line_handler.rb:30:in `handle'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/commands_generator.rb:42:in `block (2 levels) in run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane_core-0.59.0/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/commands_generator.rb:175:in `run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/commands_generator.rb:13:in `start'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/lib/fastlane/cli_tools_distributor.rb:47:in `take_off'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/fastlane-1.92.0/bin/fastlane:5:in `<top (required)>'
from /Users/user/.rbenv/versions/3.1.0/bin/fastlane:25:in `load'
from /Users/user/.rbenv/versions/3.1.0/bin/fastlane:25:in `<top (required)>'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli.rb:484:in `exec'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.3/libexec/bundle:48:in `block in <top (required)>'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
from /Users/user/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bundler-2.3.3/libexec/bundle:36:in `<top (required)>'
from /Users/user/.rbenv/versions/3.1.0/bin/bundle:25:in `load'
from /Users/user/.rbenv/versions/3.1.0/bin/bundle:25:in `<main>'
So I tried to bump Fastlane but it didn't work because of rubyzip, more specifically:
Bundler could not find compatible versions for gem "rubyzip":
In snapshot (Gemfile.lock):
rubyzip (= 2.3.2)
In Gemfile:
assertthat-bdd was resolved to 1.6.3, which depends on
rubyzip (~> 1.0, >= 1.0.0)
fastlane was resolved to 2.211.0, which depends on
rubyzip (>= 2.0.0, < 3.0.0)
I cloned this repo locally and bumped the rubyzip version to ~> 2.0 which enabled using Fastlane 2.x and fixed the error during upload.
I didn't create a PR because I'm unsure of the implications of bumping the version. It is solving my limited use case but perhaps there are more people who would benefit from that.
When using Fastlane to define an action that uses
assertthat-bddgem to upload reports, I noticed that Fastlane version was resolving to1.9.2. It was a problem because that version is using an older JSON gem and this causesAssertThatBDD::Report.uploadto crash with the following output:So I tried to bump Fastlane but it didn't work because of
rubyzip, more specifically:I cloned this repo locally and bumped the
rubyzipversion to~> 2.0which enabled using Fastlane2.xand fixed the error during upload.I didn't create a PR because I'm unsure of the implications of bumping the version. It is solving my limited use case but perhaps there are more people who would benefit from that.