我的用的是ruby-china的源 gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
開始安裝:
sudo gem install -n /usr/local/bin cocoapods?
然后告訴我 ruby的版本必須 >=2.2.2 當(dāng)前版本為 ruby 2.0.0p648
安裝ruby一般都是通過rbnv或rvm來安裝虱疏,但是要按這倆必須安裝homebrew 般婆,接下來安裝brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are .git .github .gitignore
根據(jù)提示嘗試刪除brew重新安裝
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
刪除失敗摧扇,沒有訪問這些目錄的權(quán)限
The following possible Homebrew files were not deleted:
/usr/local/.DS_Store
/usr/local/.git/
/usr/local/.github/
You may consider to remove them by yourself.
You may want to restore /usr/local's original permissions
sudo chmod 0755 /usr/local
sudo chown root:wheel /usr/local
再三嘗試無果甸怕,只好手動刪除這三個(gè)目錄
irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.DS_Store
irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.git
irondeMacBook-Pro:~ IRON$ sudo rm -rf /usr/local/.github
之后安裝成功
按照ruby-chain的教程? 如何快速正確的安裝 Ruby, Rails 運(yùn)行環(huán)境
接下來,安裝這三個(gè)東西
brew install libxml2?
brew install libxslt
brew install homebrew/dupes/libiconv
然后
$gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$\curl -sSL https://get.rvm.io | bash -s stable
$source~/.bashrc
$source~/.bash_profile
檢查一下 rvm -v ,成功灼捂。
接下來炒瘟,用rvm礼预,安裝ruby
rvm requirements
rvm install 2.3.0
rvm use 2.3.0 --default
進(jìn)行檢測
ruby -v
gem -v
安裝 Bundler ?
?gem install bundler
安裝rails
gem install rails?
測試 rails -v
接上續(xù),pod setup仍然有問題出現(xiàn)
這個(gè)錯誤應(yīng)該是是網(wǎng)絡(luò)原因
修改git的默認(rèn)postBuffer即可 ?git config --global http.postBuffer 24288000