Fastlane: ERROR: Loading command: install (LoadError)

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

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

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

Just running a bundle install produces the same error.

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.

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.

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

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

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.

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!

1 Like

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.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.