[Rails4]使用Mina部署到ubuntu server

環境:

ubuntu 14.04
mina 0.3
rails 4.1.4
(其他參考上一篇文章設定環境)

以後操作流程:

  1. 安裝mina gem
  2. 指定專案使用的ruby版本
  3. mina init (初始化)
  4. 修改deploy.rb文件
  5. mina setup (創建環境)
  6. mina deploy (部署)
  7. 設定nginx vhost (參考上一篇文章
  8. 重啟nginx server

閱讀更多

[Ubuntu] 設置rails的deploy環境

環境:

Ubuntu 14.04
Nginx
MySQL
passenger
rbenv

參考步驟:

1.主要:Deploy Ruby On Rails on Ubuntu 14.04 Trusty Tahr
2.輔助:setup production development

閱讀更多

[Rails4]引入bootstrap3卻找不到icons

事由:

以前在Rails4 使用bootstrap2.3 沒有這樣問題,升級到bootstrap3.2 卻發生照官方文件引入icons卻無法順利顯示,只顯示方塊。

解決方法:

跑去bootstrap-sass的github查看了一下文件,引入以下原始碼就完成!

$subl app/assets/stylesheets/application.css.scss

@import "bootstrap-sprockets";
@import "bootstrap";

備註:
application.css記得改成application.css.scss不然還是無法顯示icon

不過網站從bootstrap2.3升級到bootstrap3.2,幾乎整個網站都得重寫過,改變很大!


參考網址:

https://github.com/twbs/bootstrap-sass

[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

[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

閱讀更多