LoginSignup
4
0

More than 3 years have passed since last update.

pod installしたらimage not foundエラーになった時の対処法

Posted at

久々にpod installしようとしたら下記エラーになりなかなか詰まってしまったので備忘録。

 (LoadError)
  Referenced from: /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle
  Reason: image not found - /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle

解決手順

グーグル先生にsudo gem install cocoapodsしなさいと言われたので実行するとまたエラーに。

Password:
ERROR:  Loading command: install (LoadError)
    dlopen(/Users/username/.rbenv/versions/2.5.0/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/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle
  Reason: image not found - /Users/username/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin18/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

一旦Podfileを削除し、pod initし直すもまた同じエラーに。

どうやらOpenSSLが見当たらないというエラーのようで、下記Qiitaを参考にOpenSSLを入れてrubyをインストールし直しました。
Yosemiteに変えたらgem installできなくなった件

opensslのインストール

$ brew update
$ brew install openssl
$ brew link openssl --force

使っているRubyのバージョンを削除・再インストール

$ rbenv versions
  system
* 2.5.0 (set by /Users/MIYU/.rbenv/version)
$ rbenv uninstall 2.5.0
$ rbenv install 2.5.0

ちなみに、2.5.0を入れるともうすぐ死ぬよとWARNINGが出たので

WARNING: ruby-2.5.0 is nearing its end of life.
It only receives critical security updates, no bug fixes.

最新安定版の2.7.1を入れ直しました。

安定版の確認

$ rbenv install --list
2.5.8
2.6.6
2.7.1
jruby-9.2.11.1
maglev-1.0.0
mruby-2.1.0
rbx-4.15
truffleruby-20.1.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all' to show all local versions.

インストール・バージョン指定

$ rbenv install 2.7.1
$ rbenv versions
  system
* 2.5.0 (set by /Users/username/.rbenv/version)
  2.7.1
$ rbenv global 2.7.1
$ rbenv versions
  system
  2.5.0
* 2.7.1 (set by /Users/username/.rbenv/version)

再度sudo gem install cocoapods

Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, activesupport, nap, fuzzy_match, httpclient, algoliasearch, ffi, ethon, typhoeus, netrc, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, cocoapods-trunk, cocoapods-try, molinillo, atomos, CFPropertyList, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 40 seconds
33 gems installed

成功🎉
やっとpod installできました。

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0