[Rilas4] 從rvm轉到rbenv的過程

環境:

Ubuntu 14.04

操作過程:

1. 刪除RVM

rvm implode
其他注意事項:

Note you may need to manually remove /etc/rvmrc and ~/.rvmrc and ~/.rvm if they exist still.
Please check all .bashrc .bash_profile .profile and .zshrc for RVM source lines and delete or comment out if this was a Per-User installation.
Also make sure to remove ‘rvm’ group if this was a system installation.
Finally it might help to relogin / restart if you want to have fresh environment (like for installing RVM again).

2. 簡單兩步驟安裝rbenv

First you install rbenv, and then ruby-build

$ cd ~
$ git clone git://github.com/sstephenson/rbenv.git .rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL

$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
$ exec $SHELL

$ rbenv install 2.1.2
$ rbenv global 2.1.2
$ ruby -v

3. 參考網址:

Setup Ruby On Rails on Ubuntu 14.04 Trusty Tahr
move from rvm to rbenv

[Mac] 本機安裝phpmyadmin

1.將內建的MAC的apache的php開啓

sudo vi /etc/apache2/httpd.conf

#LoadModule php5_module libexec/apache2/libphp5.so
改為
LoadModule php5_module libexec/apache2/libphp5.so

Listen 80 改成 Listen 8888    #這樣就可以和powder分開,不會彼此衝突。

2.安裝PHPMyAdmin到預設網站目錄

sudo apachectl restart

安裝PHPMyAdmin
將phpMyAdmin的檔案放到『 資源庫/WebServer/Documents/』

設定phpMyAdmin

config.sample.inc.php 改成 config.inc.php, 或是複製一份
到文件裡面將
$cfg['Servers'][$i]['host'] = ‘localhost’;
改為$cfg['Servers'][$i]['host'] = ’127.0.0.1′;

#註:此步驟如果沒做,會出現登入2002錯誤

記得要重新啟動apache

3.在瀏覽器打 http://localhost:8888/phpmyadmin,完成!

[Git]常用git指令備用

1.新增ssh key到 github,讓往後push 免帳號密碼

$ ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]

然後到 ~/.ssh 資料夾底下打開 id_rsa.pub ,將ssh-rsa內容複製到 github伺服器上面。

$ ssh -T git@github.com 

這段指令可以測試是否有成功免帳號密碼登入 github

閱讀更多

[資訊] Ninite軟體懶人包

在我的工作中,很常有機會去重灌電腦。

其實重灌電腦系統很簡單,困難的是後面安裝驅動程式和常用軟體才是最麻煩的任務。但隨著經驗慢慢累積,也找到一些偷吃步技巧好節省我寶貴時間~

2013-12-19_22-55-11

網站名字:Ninite

網站位址:http://ninite.com

閱讀更多

[MAC]開機自動啟動mysql.server

開機自動啟動mysql.server

在Mac OSX中,快速設定開機自動啟動mysql.server

mkdir -p ~/Library/LaunchAgents
cp `brew --prefix mysql`/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

plist文件名不一定是homebrew.mxcl.mysql.plist,可下 $ brew --prefix mysql ,到目錄底下查看。