Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 88 lines (45 sloc) 3.62 kb
63f925d @poggs Add some documentation
authored
1
2 A Guide to Installing TSDBExplorer
3 ==================================
4
5 These instructions assume you're using Ubuntu 11.10 Server. Other operating systems and GNU/Linux distributions will likely work too.
6
7 NOTE: The installation of a database server is well outside the scope of this documentation. TSDBExplorer has been developed and tested on PostgreSQL, and it's recommended you use the latest version.
8
9 If you want to use sqlite3 or MySQL:
10
11 * For sqlite3, install libsqlite3-dev and replace the 'pg' gem in the Gemfile with 'sqlite3'
12 * For MySQL, install libmysqlclient-dev and replace the 'pg' gem in the Gemfile with 'mysql'
13
14 After either of these steps, re-run 'bundle install'. See http://guides.rubyonrails.org/getting_started.html#configuring-a-database for help on setting up sqlite3.
15
16
17 Installing Ruby
18 ---------------
19
20 The distribution-default version of Rails is likely to be old. Ubuntu 11.10 ships with Rails 2.3.14 - TSDBExplorer is written in Rails 3.1! Your version of the Ruby interpreter may also be old too. You are recommended to use Ruby Version Manager (RVM).
21
22 Follow the instructions on http://beginrescueend.com/ - or if you're impatient, just do this:
23
24 1. Run the following command:
25
26 bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
27
28 2. Read the instructions in the section starting "You must now complete the install by loading RVM in new shells". Add the necessary line to your profile, log out and log in again.
29
30 3. Run the following:
31
f44b4c2 @poggs Add functionality for importing ATOC/RSP's Master Station Names File
authored
32 apt-get install readline6-dev zlib1g-dev libxml2-dev libxslt-dev libpq-dev nodejs redis-server libproj-dev
63f925d @poggs Add some documentation
authored
33
34 rvm install 1.9.2
35 rvm use 1.9.2 --default
36
37
38 Installing TSDBExplorer
39 -----------------------
40
41 1. Create a gemset:
42
43 rvm gemset create tsdbexplorer
44
45 2. Clone the git repository:
46
47 git clone git://github.com/poggs/tsdbexplorer.git
48
49 3. Install the gems required for TSDBExplorer from the Gemfile:
50
51 bundle install
52
53 4. Copy the example configuration files:
54
55 cp config/tsdbexplorer.yml.example config/tsdbexplorer.yml
56 cp config/database.yml.example config/database.yml
57
58 5. Edit config/database.yml and configure appropriately for the database you wish to use. Leave config/tsdbexplorer.yml as-is.
59
60 6. Set up the database:
61
62 rake db:setup
63
64 9. Start the WEBrick server using 'rails server', and browse to http://localhost:3000/. Replace 'localhost' with the hostname or IP address of the server you're running Rails on.
65
66
67 Loading timetable data
68 ----------------------
69
70 As of December 2011, ATOC publish weekly timetable data on their site, http://data.atoc.org.uk/. The .MCA file within the latest archive contains timetable data in CIF format, broadly equivalent to the data available through Network Rail.
71
72 If you wish to filter the CIF data to only include specific TOCs, edit extra/split-cif.rb and change the 'toc_code' variable to be a list of the TOCs you are interested in. For more than one TOC, separate the TOC code with a comma, for example:
73
74 toc_code = ['LO', 'LM']
75
76 Next, pass the file through extra/split-cif.rb and redirect the output to another file:
77
78 cat /tmp/TTISF569.MCA | extra/split-cif.rb > LO.CIF
79
80 The file LO.CIF will contain all TIPLOC data, plus schedules for the selected TOC.
81
82 Regardless of whether you have a partial or full extract of the data, run 'rails console' and import the CIF file as follows:
83
84 TSDBExplorer::CIF::process_cif_file('LO.CIF')
85
86 This can take a long time, especially if you're using sqlite as a backend database. Once it's done, you're up and running!
87
Something went wrong with that request. Please try again.