Project

General

Profile

Ruby on Rails Application

The application code is checked into the CDCVS git repository at url ssh://p-cvdb@cdcvs.fnal.gov/cvs/projects/cvdb

Retrieve application from repository into the ~cvdb directory

git clone ssh://p-scientist-survey-rub@cdcvs.fnal.gov/cvs/projects/scientist-survey-rub cvdb

This is also mentioned in the Other Notes section.

Installed gems list

actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.2)
activeresource (2.3.2)
activesupport (2.3.2)
daemon_controller (0.2.6)
fastercsv (1.5.4)
fastthread (1.0.7)
mysql (2.8.1)
net-ldap (0.2.2)
passenger (3.0.9)
rack (1.3.4)
rails (2.3.2)
rake (0.9.2)

N.B., net-ldap and passenger are needed for the Phusion Passenger interface between Apache and Ruby on Rails.

Loading the Application Seed Data (zero time_allocations)

The ~cvdb/cvdb/loadup.sql truncates and repopulates the application data for a zero-data restart.

The file can be used in this manner:

$ mysql -D cvdb_prod2011 -u cvdb_writer -p
$ mysql -D cvdb_test2011 -u cvdb_writer -p
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 138
Server version: 5.0.77 Source distribution

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

mysql> source loadup.sql
Query OK, 100835 rows affected (0.02 sec)

Query OK, 159 rows affected (0.01 sec)

Query OK, 127 rows affected (0.01 sec)

Query OK, 2 rows affected (0.00 sec)

Query OK, 7 rows affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

+----+----------+-------+----------------------------+-------------+-----------+------------+---------+
| id | fullname | email | principal                  | employee_id | job_title | given_name | surname |
+----+----------+-------+----------------------------+-------------+-----------+------------+---------+
|  1 | * *      | ---   | inserter_of_global_records | NULL        | NULL      | NULL       | NULL    | 
+----+----------+-------+----------------------------+-------------+-----------+------------+---------+

Much output removed.

Query OK, 58 rows affected (0.01 sec)
Rows matched: 58  Changed: 58  Warnings: 0

mysql> quit
Bye
$

You can find the database passwords in the config/database.yml file.

Other notes

Thu Oct 13 13:35:48 CDT 2011
$ git clone ssh://p-scientist-survey-rub@cdcvs.fnal.gov/cvs/projects/scientist-survey-rub cvdb
Cloning into cvdb...
remote: Counting objects: 3953, done.
remote: Compressing objects: 100% (2153/2153), done.
remote: Total 3953 (delta 1482), reused 3953 (delta 1482)
Receiving objects: 100% (3953/3953), 3.43 MiB, done.
Resolving deltas: 100% (1482/1482), done.

Fri Oct 14 13:18:17 CDT 2011
Copied in config/environment.rb and config/database.yml from oink.

Fri Oct 14 13:39:44 CDT 2011
Did a gem install --user-install mysql
  Now failure is no mysql server.

Fri Oct 14 14:10:51 CDT 2011
In the application: did rake db:migrate

Monday about 5PM
Loaded the people table

Tue Oct 18 11:44:04 CDT 2011
Loaded last year's data into the tables.
The people table had to be reloaded because I needed the people to
have the same id numbers and I had an SQL error triggered by O'dell
because of the ' in her surname.