Install the prerequisites: MySQL 5+, Ruby 1.9.3 with RubyGems, Bundler gem, MySQL database. Get the latest code from GitHub. Set up database and start the web server (this will ‘'’destroy’’’ any existing racing_on_rails_development and racing_on_rails_test databases). Test http://localhost:3000.
gem install bundler git clone git://github.com/scottwillson/racing_on_rails.git cd racing_on_rails bundle rake racing_on_rails:bootstrap
Database connection problems? Check the configuration in config/database.yml
For more detail, see customization
Bike racing association name
Not interested in the Cascadia Bike Racing Association? Create your own local configuration file: local/config/environment.rb. Add your association:
ASSOCIATION = RacingAssociation.new ASSOCIATION.name = 'Oregon Bicycle Racing Association' ASSOCIATION.short_name = 'OBRA' ASSOCIATION.state = 'OR' SANCTIONING_ORGANIZATIONS = ["FIAC", "OBRA", "UCI", "USA Cycling"] unless defined?(SANCTIONING_ORGANIZATIONS)
Stop the web server (Control-C) and restart it to test.
You can also make changes to your racing association at http://localhost:3000/admin. Click on “Site.”
Web page formatting
Create a local copy of the stylesheetand modify it:
cp public/stylesheets/racing_on_rails.css local/public/stylesheets/racing_on_rails.css
Web page contents (text, links, layout)
Copy individual RHTML files from app/views to local/app/views. Rails applies the master layout template app/views/application.rhtml to all page.
You need to be an administrator user to add racers, add results, and edit the schedule.
email: email@example.com password: secret
This quick start will get you going in development. It runs Ruby’s built-in, single-threaded web server: Webrick. You need a better solution for a production web site and, for better or worse, there are many options. You best bet is Heroku or a virtual hosting service (like Linode), application server (Unicorn), and deployment tool (Capistrano).
Most Racing on Rails sites are hosted on the OBRA and WSBA servers. Email me at firstname.lastname@example.org if you would like to be hosted there as well.
Normally, Capistrano’s deployment recipe file is stored in config/deploy.rb and run by ‘cap deploy,’ but this doesn’t make sense for Racing on Rails. Every site’s deployment is a little different than the other’s. Place your custom deployment file in local/config/deploy.rb and use Capistrano directly from the command line:
You’ll need the Capistrano gem.