記事を参考にさまざまな方法を試したのですが上手くいかず投稿させていただきました。
Mac OS Moterey 12.0.1
pod --versionを行うと下記のようなメッセージが表示されました。
・ ・ ・ Ignoring bigdecimal-3.0.2 because its extensions are not built. Try: gem pristine bigdecimal --version 3.0.2 Ignoring date-3.1.1 because its extensions are not built. Try: gem pristine date --version 3.1.1 Ignoring dbm-1.1.0 because its extensions are not built. Try: gem pristine dbm --version 1.1.0 Ignoring etc-1.2.0 because its extensions are not built. Try: gem pristine etc --version 1.2.0 Ignoring ffi-1.15.4 because its extensions are not built. Try: gem pristine ffi --version 1.15.4 Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2 Ignoring fiddle-1.0.9 because its extensions are not built. Try: gem pristine fiddle --version 1.0.9 Ignoring io-console-0.5.9 because its extensions are not built. Try: gem pristine io-console --version 0.5.9 Ignoring json-2.5.1 because its extensions are not built. Try: gem pristine json --version 2.5.1 1.11.2
そこで % sudo gem pristine --all を行いました。すると下記のようなメッセージが表示されました。
Ignoring bigdecimal-3.0.2 because its extensions are not built. Try: gem pristine bigdecimal --version 3.0.2 Ignoring date-3.1.1 because its extensions are not built. Try: gem pristine date --version 3.1.1 Ignoring dbm-1.1.0 because its extensions are not built. Try: gem pristine dbm --version 1.1.0 Ignoring etc-1.2.0 because its extensions are not built. Try: gem pristine etc --version 1.2.0 Ignoring ffi-1.15.4 because its extensions are not built. Try: gem pristine ffi --version 1.15.4 Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2 Ignoring fiddle-1.0.9 because its extensions are not built. Try: gem pristine fiddle --version 1.0.9 Ignoring io-console-0.5.9 because its extensions are not built. Try: gem pristine io-console --version 0.5.9 Ignoring json-2.5.1 because its extensions are not built. Try: gem pristine json --version 2.5.1 Restoring gems to pristine condition... Restored CFPropertyList-3.0.4 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
こちらの記事を参考にさせていただき進めました。
https://kunipon.com/3221
which ruby /usr/bin/ruby which gem /usr/bin/gem
続いて rbenv init を行いました。記事ではテキストエディタが開くはずですが特に開くことはありませんでした。
# Load rbenv automatically by appending # the following to ~/.zshrc: eval "$(rbenv init - zsh)"
またこちらの記事も参考にしました。
https://qiita.com/nishina555/items/63ebd4a508a09c481150
brew install rbenv ruby-buildを行いました。
Warning: rbenv 1.2.0 is already installed and up-to-date. To reinstall 1.2.0, run: brew reinstall rbenv Warning: ruby-build 20211019 is already installed and up-to-date. To reinstall 20211019, run: brew reinstall ruby-build
rbenv versionsを確認すると下記の通りの結果となりました。
* system
rbenv install -lでヴァージョンを確認しました。
2.6.8 2.7.4 3.0.2 jruby-9.3.1.0 mruby-3.0.0 rbx-5.0 truffleruby-21.3.0 truffleruby+graalvm-21.3.0 Only latest stable releases for each Ruby implementation are shown. Use 'rbenv install --list-all / -L' to show all local versions.
rbenv install 3.0.2 を行いました。
Downloading openssl-1.1.1l.tar.gz... -> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 Installing openssl-1.1.1l... Installed openssl-1.1.1l to /Users/koichi/.rbenv/versions/3.0.2 Downloading ruby-3.0.2.tar.gz... -> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz Installing ruby-3.0.2... ruby-build: using readline from homebrew Installed ruby-3.0.2 to /Users/koichi/.rbenv/versions/3.0.2
rbenv versions でヴァージョンを確認します。
* system 2.5.3 3.0.2
rbenv global 3.0.2 します。
rbenv versions でヴァージョンを確認します。
system 2.5.3 * 3.0.2 (set by /Users/myPC/.rbenv/version)
下記を実行しました
% [[ -d ~/.rbenv ]] && \ export PATH=${HOME}/.rbenv/bin:${PATH} && \ eval "$(rbenv init -)"
パスを変更できgem pristine --all を実行しました。
which ruby /Users/myPC/.rbenv/shims/ruby which gem /Users/myPC/.rbenv/shims/gem
すると下記のメッセージが表示されました。
・ ・ ・ Restored rss-0.2.9 Skipped securerandom-0.1.0, it is a default gem Skipped set-1.0.1, it is a default gem Skipped shellwords-0.1.0, it is a default gem Skipped singleton-0.1.1, it is a default gem Skipped stringio-3.0.0, it is a default gem Skipped strscan-3.0.0, it is a default gem Skipped syslog-0.1.0, it is a default gem Skipped tempfile-0.1.1, it is a default gem Restored test-unit-3.3.7 Skipped time-0.1.0, it is a default gem Skipped timeout-0.1.1, it is a default gem Skipped tmpdir-0.1.2, it is a default gem Skipped tracer-0.1.1, it is a default gem Skipped tsort-0.1.0, it is a default gem Restored typeprof-0.12.0 Skipped un-0.1.0, it is a default gem Skipped uri-0.10.1, it is a default gem Skipped weakref-0.1.1, it is a default gem Skipped yaml-0.1.1, it is a default gem Skipped zlib-1.1.0, it is a default gem
再度pod --versionを確認しますがインストール前と変わりません。
・ ・ ・ gnoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2 Ignoring bigdecimal-3.0.2 because its extensions are not built. Try: gem pristine bigdecimal --version 3.0.2 Ignoring date-3.1.1 because its extensions are not built. Try: gem pristine date --version 3.1.1 Ignoring dbm-1.1.0 because its extensions are not built. Try: gem pristine dbm --version 1.1.0 Ignoring etc-1.2.0 because its extensions are not built. Try: gem pristine etc --version 1.2.0 Ignoring ffi-1.15.4 because its extensions are not built. Try: gem pristine ffi --version 1.15.4 Ignoring ffi-1.15.0 because its extensions are not built. Try: gem pristine ffi --version 1.15.0 Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2 Ignoring fiddle-1.0.9 because its extensions are not built. Try: gem pristine fiddle --version 1.0.9 Ignoring io-console-0.5.9 because its extensions are not built. Try: gem pristine io-console --version 0.5.9 Ignoring json-2.5.1 because its extensions are not built. Try: gem pristine json --version 2.5.1 1.11.2
そこでgem pristine json --version 2.5.1を実行してみました。
Restoring gems to pristine condition... Skipped json-2.5.1, it is a default gem
もう一つgem pristine ffi --version 1.14.2を実行してみました。
ERROR: While executing gem ... (Gem::Exception) Failed to find gems ["ffi"] = 1.14.2
% gem installを試してみます。
ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)
xcode-select --installでcommand line toolsをインストールしてみました。すると既にインストールされていることが確認できました。
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
xcodebuild -versionは最新かと思います。
Xcode 13.0 Build version 13A233
https://qiita.com/ashketcham/items/980a61f4e2de2ae1bf21
上記記事を参考にgem install ffi -- --disable-system-libffiを行いました。するとインストールできたように見えます。
Fetching ffi-1.15.4.gem Building native extensions with: '--disable-system-libffi' This could take a while... Successfully installed ffi-1.15.4 Parsing documentation for ffi-1.15.4 Installing ri documentation for ffi-1.15.4 Done installing documentation for ffi after 4 seconds 1 gem installed
再度pod --versionを行いますが以前と変わらない結果となりました。
何か解決する方法はないでしょうか。ご教示いただけますと幸いです。
あなたの回答
tips
プレビュー