pod install 和 rvm install ruby-xxxx報錯解決辦法

weixin_34087301發表於2018-08-23

pod install 報錯

configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

rvm install ruby-xxxx 報錯

Error running './configure --prefix=/Users/zhaowenbin/.rvm/rubies/ruby-2.5.1 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl@1.1 --disable-install-doc --enable-shared',
please read /Users/zhaowenbin/.rvm/log/1534992298_ruby-2.5.1/configure.log
There has been an error while running configure. Halting the installation.

解決辦法

命令列執行

xcode-select --install

接著執行安裝

等待數分鐘後點選完成

然後繼續執行 rvm install ruby-xxxpod install

原因可能是ruby的自動檢測和Xcode的clang編譯器衝突

完。

相關文章