Fastlane: ERROR: Loading command: install (LoadError)

#1

Bitrise Build Issue Report template

Description of the issue

Builds are failing on the fastlane step with the following error:

ERROR:  Loading command: install (LoadError)
  dlopen(/Users/vagrant/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/vagrant/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle
  Reason: image not found - /Users/vagrant/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

Environment:

Xcode 10.3.x (Mojave)

Fastlane step is causing the error

E.g.: Git Clone v3.6.0

Reproducibility

  • _Does a “Rebuild” help? NO
  • _Does a rebuild without caches help? NO
  • Does the issue happen sporadically, or every time? : It’s happening almost every time, 2 of ~15 builds have succeeded
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : Started this morning (2nd december)

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? No

Local reproduction: Linux / Android (docker based) stack builds

N/A

Build log

Emailed

2 Likes

#2

I have a similar issue with the Xcode 10.1 stack using the ios-auto-provisioning step:

| (1) iOS Auto Provision - Release                                             |
+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 1.4.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2019-12-02T06:20:41-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
$ bundle install
/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': dlopen(/usr/local/Cellar/ruby/2.5.3/lib/ruby/2.5.0/x86_64-darwin17/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError) ```
1 Like

#3

I’m having similar issues when trying to run any script that relies on gems

ERROR:  Loading command: install (LoadError)
	dlopen(/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle
  Reason: image not found - /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
1 Like

#4

Just running a bundle install produces the same error.

0 Likes

#5

For what I see at the moment, most (if not all) gem operations will throw the same error, since openssl is used on many dependencies. I tried to re-install openssl through Homebrew, and install openssl as a gem, but no success in any attempt.

0 Likes

#6

It doesn’t happen on most recent stack Xcode 11.3.x, on macOS 10.14.6 (Mojave).
But as it uses Xcode beta Apple doesn’t allow to publish builds created with this stack.
This issue currently blocks us from releasing new version in AppStore.

0 Likes

#7

I’m also facing the issue of being unable to make releases. Not only for App Store, but also for the regular QA process.

0 Likes

#8

Accordling to my findings:

Works:
Xcode 11.2.x | Ruby 2.6.5 | Bundler 2.0.2
Xcode 11.1.x | Ruby 2.6.5 | Bundler 2.0.2

Any other combination, do not works.

To temporarily unblock my builds, I include this step on projects with Xcode 11.1.x:

cd $(brew --repo); git fetch; git reset --hard origin/master; brew update
brew uninstall --ignore-dependencies openssl
brew install openssl
brew link --overwrite openssl --force

brew uninstall --ignore-dependencies wget
brew install wget
brew link --overwrite wget --force

ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/

export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include

brew upgrade ruby-build
rbenv install 2.6.5
rbenv local 2.6.5

For projects with Xcode 11.2.x, I changed the .ruby-version to use 2.6.5, and re-bundled my Gemfile.lock with 2.0.2

P.s.: This increases the build time massively.

I understand that this is not a fix, just sharing how I unblocked my builds.

Bitrise team will need to update the stacks.

@bitrise-admin @bitrisedev

0 Likes

#9

Thanks for the workaround, we are going to give it a try.
We are seeing the same error happening today on the osx-vs4mac-previous-stable stack with our resign IPA step that depends on ruby openssl gem.

0 Likes

#10

Hi everyone! :wave: Just wanted to make it clear that we’re aware of the issue and we’re currently working to find a solution that we can potentially backport to older stacks. Thanks for reporting!

2 Likes

#11

Hey @ahvth-bitrise, is there any further updates regarding this? Only am a little stuck at the moment.

Have tried some of the suggestions above (i.e force install OpenSSL) but not had much joy. I’m getting the same error as first mentioned but with the Cocoapods module. If I add a .ruby-version file and set it to 2.6.5 Cocoapods installs fine but it takes about 20mins to complete the step as it needs to install Ruby 2.6.5 via rbenv and my entire build takes too long and times out.

— UPDATE —

Don’t know if this helps but have tried our same steps using the ‘Visual Studio for Mac’ image and Ruby 2.6.3 and it works as expected.

1 Like