Skip to content

Instantly share code, notes, and snippets.

$ sudo gem update rake
$ sudo gem update --system
$ sudo gem install rake
$ sudo gem install sqlite3-ruby
$ sudo gem install sqlite3
$ cd ~/temp
$ git clone git://github.com/rails/rails.git rails3
$ cd rails3
$ git submodule init
$ git submodule update
$ sudo rake install
$ ruby -v
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin9.8.0]
$ rake --version
rake, version 0.8.7
$ gem -v
1.3.5
$ rails -v
Rails 3.0.pre
$ cd ./temp
$ rails blog -m http://www.lycom.de/files/rails-templates/hirb.txt
$ cd blog
$ ./script/about
$ ./script/server
$ open http://localhost:3000/posts
# 安装说明
$ # http://shiftcommathree.com/articles/how-to-install-mongodb-on-os-x
$ # http://www.mongodb.org/display/DOCS/Starting+and+Stopping+Mongo
$ # 下载源代码
$ # http://www.mongodb.org/display/DOCS/Downloads
$ curl -O http://downloads.mongodb.org/osx/mongodb-osx-i386-1.8.1.tgz
$ tar xzf mongodb-osx-i386-1.8.1.tgz
$ # 创建所需要的目录
# ~/.irbrc
require 'rubygems'
require 'interactive_editor'
# ~/.vimrc
if has("autocmd")
" Enable filetype detection
filetype plugin indent on
" Restore cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
$ sudo gem install pdfkit
$ sudo pdfkit --install-wkhtmltopdf
# ruby1.8.7 and rails3.0
$ rails new demo_pdfkit -m http://www.lycom.de/files/rails-templates/pdfkit.txt
$ cd demo_pdfkit
$ vim ./Gemfile
gem "pdfkit"
# config/database.yml
development:
adapter: postgresql
host: localhost
port: 5432
username: postgres
password: xxxx
database: template1
schema_search_path: public
encoding: utf8
@cnruby
cnruby / gist:794847
Created January 25, 2011 12:18
Rails程序模板与Bundler命令
rails new bundle_check_001 -m http://www.lycom.de/files/rails-templates/bundle_check_001.tmpl.rb
rails new bundle_install_002 -m http://www.lycom.de/files/rails-templates/bundle_install_002.tmpl.rb
rails new bundle_install_003 -m http://www.lycom.de/files/rails-templates/bundle_install_003.tmpl.rb