1

何かをゼロから構築するプロセスを開始する前に、ユーザー (sysadmin) が ActiveRecord などのアプリケーションの側面を構成できるようにする、Rails アプリケーションの初回構成ウィザードを提供する方法を他の誰かが提供する方法に出くわしたかどうか知りたいと思いました。構成と ActionMailer のセットアップ (SMTP、送信者など)。

クライアントにファイルの編集やコマンド ラインでのスクリプトの実行を要求するのではなく、新しいインストールをセットアップするためのクリーンで簡単な方法を提供したいと考えています。

基本的に、アプリケーションをダウンロードして展開し、起動できる必要があります。ブラウザ経由でアクセスすると、最初のセットアップ手順が案内されます。

私の質問は、これを行う方法に関するものではありませんが、すでにこれを行っている人はもっといます。このアイデアに関連する宝石、プラグインなどをすばやく検索しても、あまり見つかりませんでした。

編集/明確化

シナリオを明確にするために、これは、顧客のシステム管理者によってオンプレミスにダウンロードおよびインストールされる「シュリンクラップ」製品をサポートするためのものです。

ファイアウォールの背後にアプリケーションをデプロイした後、アプリケーションに初めてアクセスするときに、データベースなどのインストール用の特定の設定を構成するフレンドリーな方法が必要です。

このようなプロセスの例は、JIRA のセットアップ ウィザードです。

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

これは、新しい Rails アプリケーションを作成するためでも、開発プロセスをシステム化するためでもありません。

4

2 に答える 2

1

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.

于 2013-01-17T01:22:43.980 に答える
0

http://railswizard.org/では、使用する gem を選択できます。UI と isotope gem を使用してコンポーネントを選択するのは非常に革新的です。同様に別の視点は、このトップ 10 リストです: http://blog.teamtreehouse.com/10-must-have-ruby-gems

たとえば、企業が使用するデータベースと「現在の」最適な認証 gem はどちらも変化します。

構成固有の設定については、作業を軽減する方法を使用することで、構成の手間を軽減できます。たとえば、database.yml ファイルは通常、「ローカルで編集する必要がある」ファイルの 1 つです。.gitignore ファイルにその名前を入れることで、database.yml をソース管理から除外するという私たちのアプローチ。ローカルで database.yml にコピーする database.yml.example ファイルを追加し、そのファイルでアンカー (&) と参照 (*) を使用します。詳細はhttp://blog.geekdaily.org/2010/08/高度な yaml-tricking-out-your-databaseyml.html

各環境の他の変数を設定するためのその他のオプション: http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/

Rails config gemも、ここで詳しく説明されているように役立つ場合があります: How to define custom configuration variables in rails

于 2013-01-17T00:59:04.367 に答える