1. 下載 HomeBrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. 安裝rbenv
$ brew install rbenv
3. 初始化rbenv
$ rbenv init
4. 設定ruby path,編輯bash_profile檔案並增加以下兩行指令
5. 跑rbenv-doctor確定安裝順利
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
成功的話會看到下列訊息:
Remark: 第一次執行的時候看到
重開terminal後,再rbenv init一次即可順利設定PATH
6. 安裝bundler
$ gem install bundler
Remark: 若是看到 You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
不可用sudo gem install
這是PATH沒設定好,請回步驟四確認指令正確
或是按照下列指令重新安裝ruby
$ gem install calabash-android
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. 安裝rbenv
$ brew install rbenv
3. 初始化rbenv
$ rbenv init
4. 設定ruby path,編輯bash_profile檔案並增加以下兩行指令
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
重新開啟Terminal 或是source ~/.bash_profile使得設定生效
5. 跑rbenv-doctor確定安裝順利
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
成功的話會看到下列訊息:
Checking for `rbenv' in PATH: /usr/local/bin/rbenv Checking for rbenv shims in PATH: OK Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20170523) Counting installed Ruby versions: none There aren't any Ruby versions installed under `~/.rbenv/versions'. You can install Ruby versions like so: rbenv install 2.2.4 Checking RubyGems settings: OK Auditing installed plugins: OK
Remark: 第一次執行的時候看到
Checking for rbenv shims in PATH: none
重開terminal後,再rbenv init一次即可順利設定PATH
6. 安裝bundler
$ gem install bundler
Remark: 若是看到 You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory
不可用sudo gem install
這是PATH沒設定好,請回步驟四確認指令正確
或是按照下列指令重新安裝ruby
$ rbenv install 2.4.0
$ rbenv global 2.4.0
$ rbenv global
2.4.0
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
7. 安裝calabash-android$ gem install calabash-android
留言
張貼留言