pod installに失敗する


pod installすると下記のようなエラーが出る

zsh: /opt/local/bin/pod: bad interpreter: /opt/local/bin/ruby3.3: no such file or directory

sudo gem install cocoapods

ERROR:  Error installing cocoapods:
	The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
	drb requires Ruby version >= 2.7.0. The current ruby version is
ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]


そういえば、先日sudo port selfupdateしたときになんかエラー出てたな

Error: Failed to activate ruby33: Image error: /opt/local/lib/ruby3.3/gems/3.3.0/gems/bundler-2.5.9/exe/bundle already exists and does not belong to a registered port.  Unable to activate port ruby33. Use 'port -f activate ruby33' to force the activation.
    while executing
"throw registry::image-error $msg"
    ("foreach" body line 50)
    invoked from within
"foreach file $imagefiles {
                set srcfile "${extracted_dir}${file}"

                # To be able to install links, we test if we can lst..."
    invoked from within
"registry::write {
            foreach file $imagefiles {
                set srcfile "${extracted_dir}${file}"

                # To be able to instal..."
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby33/ruby33/main.log for details.
Error: Couldn't activate ruby33 3.3.1_0+yjit: 1
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a


  • sudo port selfupdateからのsudo port upgrade outdated
  • ruby33のインストールし直し

ということで諦めて、sudo port install ruby32することにしました。

$ ruby -v
ruby 3.2.4 (2024-04-23 revision af471c0e01) [arm64-darwin23]

rubyを入れ直したので、sudo gem install cocoapods

ついでに新しいバージョンが来てたので。sudo gem update --system 3.5.10

これでやっと、pod installができるようになりました。