警告: 請絕對不要跳著裝!
- Software Update
- Install Xcode ( Mac OS X Install CD 那一塊的 >> 選擇安裝)
- Install Homebrew http://github.com/mxcl/homebrew
| # Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences. | |
| # Instructions: | |
| # Go to TextMate > Preferences... | |
| # Click Advanced | |
| # Select Folder References | |
| # Replace the following: | |
| # File Pattern |
警告: 請絕對不要跳著裝!
| # coding: UTF-8 | |
| # | |
| # 以下为 Rake 任务,功能是将普通文件系统里面的东西转移到 MongoDB GridFS 里面 | |
| # 此代码片段来自于 Homeland 项目: https://github.com/huacnlee/homeland/tree/mysql | |
| # 场景: | |
| # 老架构 Linux File Store, Paperclip, hash 目录:"https://github.com/huacnlee/homeland/blob/ca0bdd8ab26da7b780e2dae7eba12b79f41e6d65/config/initializers/paperclip_hashpath.rb" | |
| # 新架构 Mongodb GridFS, Garrierwave, 继续沿用 Paperclip 目录兼容: https://github.com/huacnlee/homeland/tree/7100ce4c506cc2c4387f25e50c533e5bbcac6cc2/app/uploaders | |
| # 整个过程不会修改任何原始数据库和上传文件 | |
| # | |
| require 'mongo' |
| require 'rubygems' | |
| # Rails on-screen logging | |
| def change_log(stream) | |
| ActiveRecord::Base.logger = Logger.new(stream) | |
| ActiveRecord::Base.clear_active_connections! | |
| end | |
| def show_log |
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |
| # | |
| # lib/mongoid/counter_cache.rb | |
| # ruby | |
| # | |
| # Created by Zhang Alex on 2011-06-17. | |
| # Copyright 2011 __ZhangHanDong__. All rights reserved. | |
| # | |
| # =================================== | |
| # class Forum | |
| # references_many :topics |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| 首先我们来生成公钥文件。Terminal下面输入 | |
| ssh-keygen -t rsa | |
| 之后在Terminal的提示里按回车。直到生成id_rsa.pub文件,生成的id_rsa.pub文件在 ~/.ssh下面。Terminal下面输入 | |
| cd ~/.ssh | |
| cp id_rsa.pub authorized_keys | |
| 上面第一句的意思是进入~/.ssh文件夹,第二句是复制id_rsa.pub为authorized_keys文件。 |
#如何将 Rails 应用程序部署到 VPS 上
如果已经在 VPS 上假设好了 Rails 生产环境,接下来就可以将部署应用程序了。
###需要用到的工具