This is the "Invocations" application for the Central Florida Freethought Community
Ruby on Rails
This application requires:
- Ruby 2.2.2
- Rails 4.2.1
Learn more about Installing Rails.
To develop the application, you can either setup Rails according to the previous instructions, or just use Vagrant.
Development with Docker
The way to install Docker depends on the platform. If you're on Mac OSX or Windows, you'll want to install Boot2Docker which will run it on a lightweight VM. There are instructions on the Docker site at https://docs.docker.com/installation/
The easiest way to run this on Docker is to use Docker Compose. The
docker-compose.yml file is set up to run a web and a db container that are both linked. To build the containers, you can run
docker-compose build from the current directory and then you can run
docker-compose up to start the containers. On first boot, you will need to run
docker-compose run web rake db:setup in another Terminal window. If everything goes well, the app will be accessible at the Docker IP on port 3000, usually http://192.168.59.103:3000
Development with Vagrant
Vagrantfile provides a way to quickly set up a Vagrant development box with everything needed for the application. To use it,
- Install Vagrant,
- Install the
librarian-chefplugin for Vagrant:
vagrant plugin install vagrant-librarian-chef.
- Pull down the Git submodules, by running
git submodule initand
git submodule update
- From the project directory run
vagrant upto start provisioning the server.
After the virtual Machine is running, you can login to it with
vagrant ssh. From the
/vagrant directory, run
bundle install to pull down the application dependencies.
Configure environment variables
- Rename the
.envand populate it with your values.
rake secretto generate some values for both the
To configure the database settings, rename the
config/database.yml.example file to
config/database.yml, change any necessary values, and then run
bundle exec rake db:setup to create the database, perform the migrations, and create the admin user account.
Set up will seed the database and create a new admin user account with the email and password specified in the
config/secrets.yml file, which will use the
.env variables. This should be fine for development but feel free to change them.
Launch the server
After all of the above, restart the VM and with
vagrant reload. To launch the server, log back in run
cd /vagrant && foreman run rails server to start the app. Point your browser to http://localhost:3000.
Before committing, or at least pushing, be sure your tests pass by running
foreman run rspec. If you get an error regarding phantomjs, try manually install it via
sudo apt-get install phantomjs -y.
||Controllers for the app|
||Custom helper methods|
||Define custom mailers here|
||Models for the app that typically model the database|
||Custom service utilities|
||Contains configuration files for the application|
||Settings common to all environments|
||Environment-specific app settings|
||Settings that will be loaded during app startup|
||Used for configuring the settings for deploying the app|
||Database schema and migrations|
||Extra Ruby libraries and Rake tasks|
||Static assets and error files|
||RSpec files for testing|
||Spec for application dependencies|