-
Notifications
You must be signed in to change notification settings - Fork 8
Quick Start
NOTE: This page pertains only to the standard or 'single tenant' version of the starter kit. Instructions for the multi-tenant version are coming soon.
Pre-requisites: You must have Node, Bower and Ruby (2.2.4) installed.
If you already have these installed, you'll have this starter kit running in minutes.
NOTE: Node must be installed system-wide, and not merely with NVM. Its okay if you are using NVM, just install Node system-wide too.
If you wish to use a different Ruby version, remember to also change it in the Gemfile (near the top). At present, Ruby 2.3 is not supported. We are working on it.
-
Download or clone this repo
-
Run the following command in the application's root directory:
$ bundle installThis should set up all the gems required. Note: Installing the pg gem can be a pain. See http://stackoverflow.com/questions/19262312/installing-pg-gem-failure-to-build-native-extension for help.
-
Create two databases named as follows, or edit /config/database.yml to suit your needs, and then create the appropriate databases:
- rask-dev (for developing)
- rask-test (for testing)
Also change the production database details, either now, or before you wish to push your app to production. If you use Heroku, these details will be overridden anyway, but its still good to change them, for completeness.
If you are getting a database connection error, and to your knowledge have set up your database correctly, try uncommenting the following lines in /config/database.yml, and edit to suit your needs:
host: localhost port: 5432 -
Run the following command:
$ rake db:migrateThis will set up the required tables in the database. If a rake version mismatch throws up an error, run the command (and all future rake commands) in the bundler's context as follows:
bundle exec rake db:migrate. -
Change the session key in /config/initializers/session_store.rb to suit your application.
-
Add some seed data to the database:
$ rake db:seedThis will create a user with email 'admin@test.com', with password 'password', give it 'admin' priveleges, and create a post on its behalf.
This section only applies if you are using RubyMine. If you are directly using [foreman] (https://github.com/ddollar/foreman), feel free to skip it.
Since we maintain a Procfile for declaratively running the app, we need to set up RubyMine to use this Procfile, by creating a custom run/debug configuration. The default RubyMine configuration does not pick up the Procfile.
-
Install the 'foreman' gem:
$ gem install foremanNote that if you have had Heroku Toolbelt installed for long enough, it is likely that foreman was installed with it (newer versions have replaced it with Heroku Local). Even if this is the case, some older versions of foreman throw an error when loading the application's YAML config files. In this case, get the latest version of foreman by doing the following:
$ gem uninstall foreman $ gem install foreman -
Set up a RubyMine run/debug configuration as follows:
- Click on Run > Edit Configurations
- Click on the '+' button, then select 'Gem Command'
- Enter the following: Name: Foreman, Gem name = foreman, Executable name = foreman, Arguments = start
As tested on RubyMine 2016.1 on Ubuntu 16.04, this configuration works for both running and debugging. Be sure to set all environment variables either in a '.env' file (which if present, is read by foreman), or directly on this configuration.
Normally, you would not need to set environment variables to run and work with Rails console, but if you do, then set all required variables on the 'Rails console: xxx' configuration.
NOTE: Merely to run the application, you don't really need to set any environment variables, but to use many of its advanced features, you do. See possibilites on the Advanced Setup page.
Running/debugging via this configuration will start up both the web and worker (for background jobs) processes.
-
Run the app!
-
Set up the starter kit's more advanced features such as third party authentication, outgoing email, attachments and more, via instructions on the Advanced Setup page
-
Or, understand the application directory and file structure on the Application Structure page
-
Or, hide/disable the 'posts' functionality (that illustrates the tools and functionality this starter kit makes available to you) if you don't need it