Create gemset
[Email protected]: ~ $ Rvm gemset list
Gemsets for ruby-1.9.3-p547 (found in/home/apps/. rvm/gems/ruby-1.9.3-p547)
=> (Default)
Global
[Email protected]: ~ $ Rvm gemset create xmnewcrm
Ruby-1.9.3-p547-# gemset created/home/apps/. rvm/gems/[email protected]
Ruby-1.9.3-p547-# Generating xmnewcrm wrappers ........
[Email protected]: ~ $ Rvm gemset list
Gemsets for ruby-1.9.3-p547 (found in/home/apps/. rvm/gems/ruby-1.9.3-p547)
=> (Default)
Global
Xmnewcrm
[Email protected]: ~ $ Ruby-V
Ruby 1.9.3p547 (Revision 45962) [x86_64-linux]
Deployment
[Email protected]: ~ /Xmnewcrm $ CAP production deploy
On the deployed node Server
[Email protected]: ~ $ Ll/APP/rails/xmnewcrm.xiaoma.com/shared/
Total 16
Drwxrwxr-x 4 apps 4096 Aug 29 ./
Drwxr-XR-x 5 apps 4096 Aug 29 ../
Drwxrwxr-x 2 apps 4096 Aug 29 bin/
Drwxrwxr-x 3 apps 4096 Aug 29 bundle/
[Email protected]: ~ $ Mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/config
[Email protected]: ~ $ Mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/tmp
[Email protected]: ~ $ Mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/log
[Email protected]: ~ $ Mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/public
[Email protected]: ~ $ Vim/APP/rails/xmnewcrm.xiaoma.com/shared/config/database.yml
# SQLite version 3.x
# Gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your gemfile
# Gem 'sqlite3'
Development:
Adapter: MySQL
Database: xmnewcrm
Username: Root
Password: ergal1234
Encoding: utf8
# Pool: 5
# Timeout: 5000
# Warning: the database defined as "test" will be erased and
# Re-generated from your development database when you run "rake ".
# Do not set this dB to the same as development or production.
Test:
Adapter: sqlite3
Database: DB/test. sqlite3
Pool: 5
Timeout: 5000
Production:
Adapter: mysql2
Database: xmnewcrm
Username: Root
Password: ergal1234
Encoding: utf8
Staging:
Adapter: mysql2
Encoding: utf8
Database: xmnewcrm
Pool: 5
HOST: localhost
Username: Root
Password: ergal1234
Create a Project Database
[Email protected]: ~ $ Mysql-uroot-pergal1234
Welcome to the MySQL monitor. commands end with; or \ G.
Your MySQL connection ID is 36
Server version: 5.5.35-0ubuntu0. 12.04.2 (UBUNTU)
Copyright (c) 2000,201 3, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> Create Database xmnewcrm;
Query OK, 1 row affected (0.01 Sec)
Deployment
[Email protected]: ~ /Xmnewcrm $ CAP production deploy
Start
[Email protected]: ~ /Xmnewcrm $ CAP production deploy: Start
Cap staging deploy
218 cap staging deploy: start_ps
219 cap staging deploy: stop_ps
220 CAP production deploy: Start
11 mkdir/APP/rails/xmnewcrm.xiaoma.com/
12 ruby-V
13 rvm-V
14 LL. Ssh/
15 CAT. Ssh/id_dsa.pub
16 SSH [email protected]
17 ruby-V
18 rvm-V
19 LL. Ssh/
20 LL
21 \ curl-SSL https://get.rvm.io | bash-s stable
22 LL
23 rvm-V
24 ruby-V
25 rvm install 1.9.3
26 Source/home/apps/. rvm/scripts/rvm
27 ruby-V
28 rvm-V
29 rvm install 1.9.3
30 echo $?
31 SSH [email protected]
32 LL
33 ls
34 ID apps
35 git clone [email protected]: xmnewcrm
36 cat. Ssh/id_dsa.pub
37 git clone [email protected]: xmnewcrm
38 LL
39 rvm gemset list
40 rvm gemset create xmnewcrm
41 rvm gemset list
42 ruby-V
43 mysql-uroot-pergal1234
44 lsof-I: 3306
45 LL/APP/rails/xmnewcrm.xiaoma.com/
46 LL/APP/rails/xmnewcrm.xiaoma.com/shared/
47 mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/config
48 *
49 Vim/APP/rails/xmnewcrm.xiaoma.com/shared/config/database.yml
50 LL/APP/rails/xmnewcrm.xiaoma.com/shared/
51 LL/APP/rails/xmnewcrm.xiaoma.com/shared/config/
52 LL/APP/rails/xmnewcrm.xiaoma.com/shared
53 PS aux | grep UN
54 LL/APP/rails/xmnewcrm.xiaoma.com/shared
55 mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/
56 LL/APP/rails/xmnewcrm.xiaoma.com/shared
57 mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/log
58 mkdir/APP/rails/xmnewcrm.xiaoma.com/shared/public
59 LL/APP/rails/xmnewcrm.xiaoma.com/shared
60 LL/APP/rails/xmnewcrm.xiaoma.com/shared/log/
61 LL/APP/rails/xmnewcrm.xiaoma.com/shared/public/
62 LL/APP/rails/xmnewcrm.xiaoma.com/shared/log/
63 LL/APP/rails/xmnewcrm.xiaoma.com/shared
64 ll/APP/rails/xmnewcrm.xiaoma.com
65 LL
66 ls
67 rails s-p 8000
68 ls
69 LL
70 CD/APP/rails/xmnewcrm.xiaoma.com/
71 rails s-p 8000
72 ruby-V
73 rails-V
74 gemlist
75 rails C
76 rails
77 CD/APP/rails/xmnewcrm.xiaoma.com/
78 LL
79 CD shared/
80 LL
81 ll public/
82 ll log/
83 ll public/
84 Cd ~
85 * LL/APP/rails/xmnewcrm.xiaoma.com/shared/tmp/unicorn.sock
86 history
This article is from the "8055082" blog and will not be reproduced!
Deploying Cap 2 in Ubuntu 12.04.4 lts