- download Git-1.7.4-preview20110204.exe from http://code.google.com/p/msysgit/
- git config --global user.name "Your Name"
- git config --global user.email "Your Email"
- download mongodb-win32-i386-1.6.5
- unzip to c:\mongo
- mkdir c:\data
- mkdir c:\data\db
- to start server
- c:\mongo\bin\mongod.exe
- to start shell
- c:\mongo\bin\mongo.exe
- db
- exit
- download postgresql-8.3.13-1-windows.exe
- download mysql-noinstall-5.0.91-win32.zip
- 5.1 and above would not work with Ruby
- unzip to c:\mysql-5.0.91-win32
- download rubyinstaller-1.8.7-p302.exe from http://www.ruby-lang.org/en/downloads/
- note: Rails 3 only support 1.8.7 and 1.9.2
- Ruby 1.9.2 has dependency problem with mongrel gem, so use 1.8.7 for now
- for this installation guide, assume installed location = c:\Ruby1.8.7
- create c:\Ruby1.8.7\setenv.bat
- set path=%path%;C:\Ruby187\bin
- set path=%path%;C:\Program Files\Git\cmd
- set path=%path%;C:\mysql-5.0.91-win32\lib
- alternatively, modify the system path to include the above
inspect Gems
- gem update --system
- gem list --local
- gem sources
- gem install rack
install Rails
- gem install rails --version 3.0.0
- rails -v
- bundle config build.mysql -- --with-mysql-include=c:\mysql-5.0.91-win32\include --with-mysql-lib=c:\mysql-5.0.91-win32\lib
- gem install mysql
- copy c:\mysql-5.0.91-win32\bin\libmysql.dll to c:\Ruby187\bin
install postgres driver
- gem install pg --version 0.9.0
install pagination add-on
- gem install will_paginate
install acts_as_versioned add-on
- gem install acts_as_versioned
clone existing project from server
- mkdir c:\Ruby1.8.7\rails_projects
- cd c:\Ruby187\rails_projects
- git init
- git clone user2@host:/pub/proj/project.git myclone
- bundle check
- if gems are packaged already in vendor/cache
- bundle install --local
- otherwise to install gems from rubygems.org
- bundle install
- after installing new gems or updating to newer versions
- bundle update
- create basic project template
- cd c:\Ruby187\rails_projects
- rails new new-rails-app
- cd c:\Ruby187\rails_projects\new-rails-app
- specify dependencies in a Gemfile in project's root
- c:\Ruby187\rails_projects\new-rails-app\Gemfile
- gem 'sinatra'
- gem 'mysql'
- gem 'activerecord'
- gem 'rest-client'
- gem 'json', '1.4.6'
- cannot use json 1.5.1 depends on ruby 1.9.1
- install bundle
- bundle config
- bundle install
- bundle show
- package gems to prepare for deployment
- bundle package
- create simple test
- rails generate scaffold User name:string email:string
- rails generate migration Timelines
- rails generate migration AddDetailsToTimelines timesheet_task_id:integer
- rake db:migrate
- initialize database
- rake db:create
- rake db:schema:load
- rake db:seed
- or rake db:setup to do the above 3
- start server
- rails server (or rails s)
- test in browser
- http://localhost:3000/users
- unit test
- cd test
- rake db:test:load
- ruby unit/user_test.rb
- check in
- git init
- specify files we do not want to track
- create c:\Ruby187\rails_projects\new-rails-app\.gitignore
- log/
- .bundle/
- git add .
- git commit -m "initial commit"
- cd c:\Ruby187\rails_projects\new-rails-app
- git remote add github git@github.com:mozgroup/2011.git
- git push github master
install SQLITE3 DLL
- from http://sqlite.org/download.html, download sqlite-3_7_2.zip and sqlitedll-3_7_2.zip
- extract inside C:\Ruby1.8.7\bin
install git in RadRails
- right click in Plugins Manager to install git
- HOST: git server e.g. git.mycompany.com
- REPOSITORY PATH: /home/scone/project.git
- URI: git+ssh://scone@git.mycompany.com/home/scone/project.git
- PROTOCOL: git+ssh
in order to support different databases in different environments
- edit C\Ruby187\rails_project\new_rails_app\Gemfile
- group :development, :test do gem 'sqlite3-ruby', :require => 'sqlite3' end
- group :production, :staging do gem 'pg', '0.9.0' end
- note: 0.10.0 not working on windows
- install pg (postgresql driver gem)
- install postgres from
- bundle config
- bundle config build.pg --with-pg-include=c:\Program Files\PostgreSQL\8.3\include
- bundle config config.pg --with-pg-config=c:\Program Files\PostgreSQL\8.3\bin
- bundle
install heroku
- gem install heroku
- heroku keys:add
- assumimg exisitng public and private keys in user home folder
- heroku create new_rails_app
- heroku config:add BUNDLE_WITHOUT="development test"
- git push heroku master
set up heroku database schema
- heroku run rake db:migrate --trace --app app_name
inspect heroku database setup
- heroku console
- ActiveRecord::Base.connection.tables
populate heroku database from local development database
- gem install taps
- heroku db:push
inspect heroku
- more .git\config
- heroku list
- git remote show heroku
- gitk --all
- heroku logs
No comments:
Post a Comment