###比較gem,rvm,brew命令git
###深刻理解幾個命令 rvm Gem是封裝起來的Ruby應用程序或代碼庫 Gems 相似RedHat的RPM.它將一個Ruby應用程序打包到一個gem裏,做爲一個安裝單元。 無需安裝,最新的Ruby版本已經包含RubyGems了。RubyGems(簡稱 gems) ruby bundle 至關於多個RubyGems批處理運行。在配置文件gemfilel裏說明你的應用依賴哪些第三方包,他自動幫你下載安裝多個包,而且會下載這些包依賴的包 source brew ,又叫Homebrew,是Mac OSX上的軟件包管理工具 //mac 安裝brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
###$ gem listgithub
gem list --local | grep cocoapods緩存
查看ruby的本地包 *** LOCAL GEMS *** activesupport (4.1.8, 3.2.21) bigdecimal (1.2.0) CFPropertyList (2.2.8) claide (0.7.0) cocoapods (0.35.0, 0.34.1, 0.34.0) cocoapods-core (0.35.0, 0.34.1, 0.34.0) cocoapods-downloader (0.8.0, 0.7.2) cocoapods-plugins (0.3.2) cocoapods-trunk (0.4.1, 0.2.0) cocoapods-try (0.4.2)
###安裝cocoapodsruby
gem update --system gem install cocoapods pod setup
###清理pods緩存bash
$ sudo rm -fr ~/Library/Caches/CocoaPods/ $ sudo rm -fr ~/.cocoapods/repos/master/ //卸載 $ sudo gem uninstall cocoapods -v 0.35.0
http://blog.csdn.net/hengshujiyi/article/details/40303457less
###可能遇到問題curl
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory 解決辦法: sudo gem system update
###卸載cocoapodside
sudo gem uninstall cocoapods
###安裝和卸載版本工具
gem uninstall cocoapods -v 0.20.2 sudo gem install cocoapods -v 0.35.0
###關於rvm管理ruby包url
安裝RAV curl -L get.rvm.io | bash -s stable source /Users/knight.lu/.rvm/scripts/rvm //根據提示 安裝ruby指定版本 ruby -v //查看版本號 rvm list known //列出已知的ruby版本 rvm install 2.3 //安裝ruby 2.3版本 sudo rvm uninstall 2.3.3 //卸載2.3.3版本 rvm cleanup all //清理冗餘數據 rvm default use 2.4 //使用2.4版本 rvm current //如今使用的版本 解決使用cocoapods插件報錯:env: ruby_executable_hooks: No such file or directory 終端輸入 which ruby_executable_hooks /Users/knight.lu/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks Xcode-> Product-> cocoaPods - >GEM_PATH 輸入 /Users/knight.lu/.rvm/gems/ruby-2.3.0/bin
###rootless
sudo nvram boot-args="kext-dev-mode=1 rootless=0";sudo reboot