ruby-on-railsdeploymentconfigurationsetup-wizard

Allow user to configure Rails application for first use (ActiveRecord etc)


Before I start the process of building something from scratch I was curious if anyone else had come across a way of providing a first-time configuration wizard for a Rails application that allows the user (sysadmin) to configure aspects of the application such as the ActiveRecord configuration and the ActionMailer setup (SMTP, sender etc).

We'd like to provide a clean easy way for new installs to get setup, rather than asking clients to edit files, or run scripts on the command line.

Essentially you should be able to download the application, extract it, start it, and when you access it via the browser you're guided through the initial setup steps.

My question isn't so much around how to do this, but more has anyone already done this. My quick search for gems, plugins etc around this idea didn't turn up much.

Edit/Clarification

To clarify the scenario - this is to support "shrink-wrapped" products that are downloaded and installed on-premises by the customer's sys admin.

The first time they access our application after deploying it behind their firewall we want a friendly way of configuring the specific settings for their install, such as database etc.

An example of such a process is JIRA's setup wizard:

https://confluence.atlassian.com/display/JIRA/Running+the+Setup+Wizard

This isn't for reating new rails applications, or systemising our development process.


Solution

  • I like Rails Templater a lot. It is a command line tool to build a rails app. It asks you questions like "Would you like to use rspec? Pry instead of IRB?"
    I have created a fork that adds authentication, twitter bootstrap and backbone.js and some other options. It is pretty easy to hack on if you have specific needs. I use it all the time and I would hate not having it.
    It is of course a command line app and not usable via the browser but maybe it will still fit your needs. Or the codebase could be integrated into a client web application.

    Update after comment
    You may be able to bootstrap a sqlite database so the app can boot, then just using a form or a wizard to set up something that writes your database.yml and other configs, maybe by means of thor (makes appending/replacing text in files simple and is part of rails). You would need to somehow restart the rails app and migrate the database. You could keep the pg or mysql2 gem (or both) in your Gemfile or again use thor to edit them from your wizard/form.

    I also recommend using rails_config as Michael suggested. With the above solution.

    If I had more time to think about the problem, I may come up with something cleaner but this is how I would do it if I had to right now.