熱門文章

2015年7月18日 星期六

[OS X]安裝Ruby On Rails

Setup Ruby On Rails on
Mac OS X 10.10 Yosemite


首先,OS X 的使用者使用 Homebrew 作為套件管理工具。
First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.
Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.
Open Terminal and run the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
出現以上畫面,按[enter]鍵繼續。

安裝中。。。

完成第一步驟,安裝Homebrew。

Choose the version of Ruby you want to install:
Now that we have Homebrew installed, we can use it to install Ruby.
We're going to use rbenv to install and manage our Ruby versions.
To do this, run the following commands in your Terminal:
brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby
rbenv install 2.2.2
rbenv global 2.2.2
ruby -v

install rbenv ruby-build
done.
step2-2
rbenv install 2.2.2


使用 ruby -v 查詢結果還是2.0
試試重開




 yes!2.2

We'll be using Git for our version control system so we're going to set it up to match our Github account. If you don't already have a Github account, make sure to register. It will come in handy for the future.
Replace the example name and email address in the following steps with the ones you used for your Github account.
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -C "YOUR@EMAIL.com"
The next step is to take the newly generated SSH key and add it to your Github account. You want to copy and paste the output of the following command and paste it here.
cat ~/.ssh/id_rsa.pub
Once you've done this, you can check and see if it worked:
ssh -T git@github.com
You should get a message like this: 
Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.



Your identification has been saved in /Users/QJpioneer/.ssh/id_rsa.
Your public key has been saved in /Users/QJpioneer/.ssh/id_rsa.pub.
The key fingerprint is:
25:00:95:e8:ba:a2:4a:ed:91:26:41:37:cb:32:f3:f3 qjpioneer@gmail.com
The key's randomart image is:
+--[ RSA 4096]----+
|    .+o.         |
|    . ..         |
| . +    . .      |
|. o +    o       |
| = +    S        |
|  O .            |
| o O             |
|o = +            |
|=. . E           |
+-----------------+


https://gorails.com/setup/osx/10.10-yosemite
https://ihower.tw/rails4/installation.html


沒有留言:

張貼留言