質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.30%
Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

Q&A

1回答

566閲覧

CocoaPods installed but not working.

owoKNowo

総合スコア1

Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

0グッド

0クリップ

投稿2023/12/24 10:59

実現したいこと

  • Flutterの環境構築

前提

ここの通りに構築していました。

発生している問題・エラーメッセージ

flutter doctorを打つと以下のようなメッセージが出力されます。

[✓] Flutter (Channel stable, 3.16.5, on macOS 14.0 23A344 darwin-arm64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [!] Xcode - develop for iOS and macOS (Xcode 15.1) ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.84.2) [✓] Connected device (2 available) [✓] Network resources

試したこと

案内されたURLでインストールし直す:

% sudo gem install cocoapods Password: Successfully installed cocoapods-1.14.3 Parsing documentation for cocoapods-1.14.3 Done installing documentation for cocoapods after 0 seconds 1 gem installed

効果なし。

homebrewを用いてインストール:

% brew install cocoapods ==> Downloading https://formulae.brew.sh/api/formula.jws.json ==> Downloading https://formulae.brew.sh/api/cask.jws.json Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods Warning: cocoapods 1.14.3 is already installed and up-to-date. To reinstall 1.14.3, run: brew reinstall cocoapods

効果なし。

pod setupしてみる:

[BUG] Segmentation fault at 0x0000000029326620 ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [-darwin23] -- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. ... zsh: abort pod setup

クラッシュしました。クラッシュレポートは長いので割愛します。当然効果なし。

補足情報(FW/ツールのバージョンなど)

OS: macOS Sonoma Ver.14.0
chip: Apple M2

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [-darwin23]

rubyが古すぎませんか?
おそらくMacOS標準の古いrubyを利用しているのでしょう。
homebrewやrbenvで新しいrubyをインストールしてください。

% ruby -v ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] % pod --version 1.14.3 % pod setup Setup completed

投稿2023/12/24 14:54

technocore

総合スコア7398

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

owoKNowo

2023/12/25 01:41

[ここ](https://zenn.dev/blendthink/articles/f0964e3642d33b)に基づいてrbenvを利用してダウンロードしました: ``` % rbenv versions system * 3.2.2 (set by /Users/username/.ruby-version) ``` が、認識できていないようです: ``` % ruby -v ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [-darwin23] % ruby --version ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [-darwin23] ``` rvmでinstallしたものしか認識できていないようです。しかし、ならばとrvmを利用するとエラーが起きます。 ``` % rvm install 3.2.2 Searching for binary rubies, this might take some time. No binary rubies available for: osx/14.0/arm64/ruby-3.2.2. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem' is already up to date. Requirements installation successful. Installing Ruby from source to: /Users/username/.rvm/rubies/ruby-3.2.2, this may take a while depending on your cpu(s)... ruby-3.2.2 - #downloading ruby-3.2.2, this may take a while depending on your connection... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 19.5M 100 19.5M 0 0 9144k 0 0:00:02 0:00:02 --:--:-- 9155k No checksum for downloaded archive, recording checksum in user configuration. ruby-3.2.2 - #extracting ruby-3.2.2 to /Users/username/.rvm/src/ruby-3.2.2 - please wait ruby-3.2.2 - #configuring - please wait ruby-3.2.2 - #post-configuration - please wait ruby-3.2.2 - #compiling - please wait Error running '__rvm_make -j8', please read /Users/username/.rvm/log/1703462104_ruby-3.2.2/make.log There has been an error while running make. Halting the installation. ```
technocore

2023/12/25 02:07

>が、認識できていないようです: rbenvを有効にするための設定をしていないからです。
owoKNowo

2023/12/26 04:45

`rbenv init`からやり直してrubyのバージョンを最新にすることはできました: ``` % ruby -v ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23] ``` その後、`sudo gem install cocoapods`を実行しましたが、解決せずでした: ``` % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.5, on macOS 14.0 23A344 darwin-arm64, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [!] Xcode - develop for iOS and macOS (Xcode 15.1) ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is not working. This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it. This can usually be fixed by re-installing CocoaPods. To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.84.2) [✓] Connected device (2 available) [✓] Network resources ```
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.30%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問