From 1a3a4287b00acc054b1ef07526a569cd4b504939 Mon Sep 17 00:00:00 2001 From: James Dinkel Date: Thu, 28 Dec 2023 00:13:50 -0600 Subject: [PATCH] Getting ready to use database --- Gemfile | 6 ++++++ README.md | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3606de8..6e8b26c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,12 @@ gem 'roda' gem 'rack-unreloader' gem 'tilt' gem 'erubi' +gem 'sequel' + +# Change to whatever database you plan to use +gem 'sqlite3' +# gem 'pg' # will also want gem sequel-pg +# gem 'mysql2' # change to gunicorn or passenger if you prefer: gem 'puma' diff --git a/README.md b/README.md index 83f577f..e8d83d1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ For the single file app template, really the only file you need is the config.ru and run it with puma. +## Database + ## Views In this template, I've taken the single-file template and split up the config.ru to put routes and app logic in app.rb and call on templates to render proper html pages. `tilt` and `erubi` gems are added to do the rendering, and `rack-unreloader` gem is added to have puma automatically load file changes while running in development mode. @@ -21,7 +23,7 @@ Will need ruby; install it via package manager or a ruby manager like rbenv/ruby With this example, will basically just ignore the project's Gemfile. Debian 12 has a pretty current ruby version so just using it. ``` -sudo apt install ruby ruby-rack puma ruby-erubi ruby-tilt +sudo apt install ruby ruby-rack puma ruby-erubi ruby-tilt ruby-sequel ruby-sqlite3 sudo gem install roda rack-unreloader ```