ReactNative遇到info Installing required CocoaPods dependencies卡死的问题

最近换了mac,第一次使用rn做ios的项目

发现一个问题,在使用react-native run-ios的时候,会遇到

info Installing required CocoaPods dependencies

卡着一直不动,盲猜是install的源不好使了。

了解了一下之后,CocoaPods这个东西是基于ruby gem的,换源!

~ which pod
/usr/local/bin/pod

这个是查看cocoapods安装位置。

~ sudo rm -rf /usr/local/bin/pod
possword:

卸载cocoapods

~ gem list

查看一下gem安装的东西

*** LOCAL GEMS ***

activesupport (4.2.11.1)
atomos (0.1.3)
bigdecimal (1.2.8)
CFPropertyList (3.0.1, 2.2.8)
claide (1.0.3)
cocoapods (1.7.5)
cocoapods-core (1.7.5)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.4.0)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.5)
did_you_mean (1.0.0)
escape (0.0.4)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
io-console (0.4.5)
json (1.8.3.1)
libxml-ruby (2.9.0)
minitest (5.8.5)
molinillo (0.6.6)
nanaimo (0.2.6)
nap (1.1.0)
net-telnet (0.1.1)
netrc (0.11.0)
nokogiri (1.5.6)
power_assert (0.2.6)
psych (2.1.0.1)
rake (10.4.2)
rdoc (4.2.1)
ruby-macho (1.4.0)
sqlite3 (1.3.11)
test-unit (3.1.5)
thread_safe (0.3.6)
tzinfo (1.2.5)
xcodeproj (1.12.0)

然后吧cocoapods的内容删掉!

 ~ sudo gem uninstall cocoapods cocoapods-core //所有带cocoapods都删掉

然后gem list再看一下删除没有

~ gem update --system //这里请先科学上网一哈啊
~ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
~ gem sources -l
https://gems.ruby-china.com

确保只有ruby-china.com这一个源,ruby-china.com不能用了,taobao.org也不行了。

~ sudo gem install cocoapods
password

~ pod setup

耐心等待一下,完成!

然后再初始化rn项目,完美解决!

你可能感兴趣的:(react,ReactNative,gem)