---
title: "在linux下部署ROR项目"
author: "PBFox"
date: "2008-01-08T16:24:00Z"
tags: []
slug: "linux-ror"
draft: false
lastmod: "2008-01-08T16:24:00Z"
id: 479239
url: "https://developerwork.iteye.com/blog/479239"
---

client让我远程 帮他把项目部署到服务器上。什么都没给，只好自己想办法，边查资料边部署。  
首先把代码给搞下来。  
\[yzhang@localhost ~]$ mkdir trust  
\[yzhang@localhost ~]$ cd trust  
\[yzhang@localhost trust]$ svn checkout http://...............................................................  
用户名：  
密码：  
\[yzhang@localhost trust]$ cd trunk  
\[yzhang@localhost trunk]$ ls  
app config doc lib public README sendmails.rb tmp  
components db document log Rakefile script test vendor  
\[yzhang@localhost trunk]$ vi config/database.yml

从命令行模式转到末行模式用 “：”，然后用wq保存修改并推出。

\[yzhang@localhost trunk]$ vi config/database.yml  
\[yzhang@localhost trunk]$ pwd  
查看当前目录路径  
/home/yzhang/trust/trunk  
\[yzhang@localhost trunk]$ mongrel\_rails cluster::configure -e development -p 8090 -N 4 -c /home/yzhang/trust/trunk -a 127.0.0.1  
Writing configuration file to config/mongrel\_cluster.yml.  
\[yzhang@localhost trunk]$ mongrel\_rails cluster::start  
starting port 8090  
starting port 8091  
starting port 8092  
starting port 8093  
\[yzhang@localhost trunk]$ pwd  
/home/yzhang/trust/trunk  
\[yzhang@localhost trunk]$ mysql -u wwsr\_user -p  
Enter password:  
Welcome to the MySQL monitor. Commands end with ; or \\g.  
Your MySQL connection id is 57  
Server version: 5.0.45 Source distribution

Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.

mysql&gt; create database trust\_develop  
\-&gt; ;  
Query OK, 1 row affected (0.01 sec)

mysql&gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP  
\-&gt; ON trust\_develop.*  
\-&gt; TO 用户名@localhost  
\-&gt; IDENTIFIED BY '密码';  
Query OK, 0 rows affected (0.09 sec)

mysql&gt; show databases;  
+--------------------+  
| Database |  
+--------------------+  
| information\_schema |  
| test |  
| trust\_develop |  
+--------------------+  
3 rows in set (0.00 sec)

mysql&gt; use trust\_develop  
Database changed  
mysql&gt;source /home/yzhang/trust/tags/trust.sql 还原数据库。