Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A site focussed on connecting and empowering people who share transport problems of different kinds.
Ruby HTML CSS JavaScript Python Shell
Failed to load latest commit information.
app Add to error array using <<
commonlib @ b94e1b6 Autorotate uploaded images based on EXIF orientation
config Move to Rails LTS for 2.3 series security fix support.
data Include Google/v3.js in OpenLayers build files.
db Add boolean flag for skipping alerts about not having an email addres…
doc Initial rails skeleton
lib Add a temp task to list recent users for notification of site closure.
public Add frontpage notice.
script Mail delivery failures should go to cron address, not support.
spec Mark specs that fail as a result of turning off problem reporting as …
tmp Initial rails skeleton
vendor/plugins
.autotest Run sweeper specs using autotest
.gitignore Handle ruby gem dependencies with bundler.
.gitmodules Adding commonlib as a submodule
.ruby-version Move .rvmrc file to .ruby-version
Gemfile Move to Rails LTS for 2.3 series security fix support.
Gemfile.lock Update Rails LTS version
LICENSE.txt First things first - license.
README.md Suppress deprecation warnings.
Rakefile Don't need rdoctask with newer version of rake.
data_model.md More tweaks

README.md

FixMyTransport

Data Model

See https://github.com/mysociety/fixmytransport/blob/master/data_model.md

Prerequisites

Ruby 1.8.7

Installation

OS X

Get the code:

git clone https://github.com/mysociety/fixmytransport

In a terminal, navigate to the fixmytransport folder where this install guide lives.

You will also want to install mySociety's common ruby libraries. Run:

git submodule update --init

to fetch the contents of the submodule.

Copy config/general.yml-example to config/general.yml

Configure the database:

Install Postgres and PostGIS - OSX installers are available at http://www.kyngchaos.com/software/postgres

  • copy database.yml-example to database.yml in fixmytransport/config
  • edit it to point to your local postgresql database in the development and test sections and create the databases:

Become the 'postgres' user (sudo su - postgres) (or whatever user postgres is running as)

psql template1 to get into command tool

\l to list databases

CREATE DATABASE fixmytransport_development encoding = 'UTF8';
CREATE DATABASE fixmytransport_test encoding = 'UTF8';

Make sure that the user specified in database.yml exists, and has full permissions on this database.

CREATE USER <username> WITH CREATEUSER;
ALTER USER <username> WITH PASSWORD '<password>';
ALTER USER <username> WITH CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE fixmytransport_development TO <username>;
GRANT ALL PRIVILEGES ON DATABASE fixmytransport_test TO <username>;     
ALTER DATABASE fixmytransport_development OWNER TO <username>;
ALTER DATABASE fixmytransport_test OWNER TO <username>;

The following commands need to be run at the command line following db creation for each of fixmytransport_development and fixmytransport_test:

createlang  plpgsql [database name]
psql [yourdb] < /usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql
psql [yourdb] < /usr/local/pgsql/share/contrib/postgis-1.5/spatial_ref_sys.sql

Also, SRID 27700 (British National Grid) is incorrect in some installs of PostGIS. After you’ve installed and got a PostGIS template, log in to it and make sure the proj4text column of SRID 27700 in the spatial_ref_sys table includes +datum=OSGB36.

Install additional packages

If you're using a Debian-based system, you should make sure that the packages listed in config/packages are all installed.

To load a new binary Postgres dump file:

  1. Create the file from an existing database with pg_dump -p [Postgres port number] --schema=public -Fc YOURDB > YOURDB.sql.dump
  2. rake db:load_from_binary FILE=YOURDB.sql.dump

Running the tests

If you want to run the RSpec tests continuously while developing, you can do this using ZenTest. You can install ZenTest and support for Rails with:

gem install ZenTest autotest-rails

Then you can run the following command in the fixmytransport directory:

RSPEC=true autotest
Something went wrong with that request. Please try again.