From 5a91e0d0ddc6a74bcac0f568f4946b599cbddcbb Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 14:52:56 -0500 Subject: [PATCH 01/13] Expanded setup instructions in Readme. --- README.md | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 159cce8..ca3abc2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,17 @@ Next Roda app template iterations will add database, then authentication. ## Setup +### Get git + +``` +sudo apt install git +git config --global user.email "myemail@gmail.com" +git config --global user.name "Full Name" +git config --global credential.helper "cache" + +git clone https://path/to/project.git +``` + ### Prereq installs Will need ruby; install it via package manager or a ruby manager like rbenv/ruby-build. Will need the roda gem, and then an application server such as puma (recommended), gunicorn, or passenger. My examples will use system ruby and puma. @@ -25,18 +36,41 @@ With this example, will basically just ignore the project's Gemfile. Debian 12 ``` sudo apt install ruby ruby-rack puma ruby-erubi ruby-tilt ruby-sequel ruby-sqlite3 rake sudo gem install roda rack-unreloader + +cd my-project ``` -#### Option 2: Bundler +#### Option 2a: Bundler system package -Run the bundle command from the project's root directory +Run the bundle install command from the project's root directory ``` -sudo apt install ruby ruby-bundler +sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ bundle config set --local path 'vendor/bundle' + +cd my-project bundle install ``` +#### Option 2b: Bundler system gem (recommended) + +Similar to above but might as well use the gem install to get the latest bundler. The Debian apt packaged bundler is currently a bit outdated and missing some features compared to the latest. + +``` +sudo apt install ruby ruby-dev gcc pkgconf make g++ +echo 'gem: --no-document' >> ~/.gemrc +sudo cp ~/.gemrc /root/ +sudo gem install bundler +bundle config set --local path 'vendor/bundle' + +cd my-project +bundle install +``` + +#### Option 3: Rbenv Ruby + +Todo + ## Run it In the project root directory: From c05c3d3a89973d75e657aea520b065fa6901714d Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 15:10:17 -0500 Subject: [PATCH 02/13] Update views/layout.erb for bulma 1.0.2 --- views/layout.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/views/layout.erb b/views/layout.erb index c5ec841..3ab9311 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -1,16 +1,16 @@ - + <%= @page_title || "My Website" %> - +
-

<%= @page_title || 'Page Title Placeholder' %>

- <% # maybe put a flash section here some day %> +

<%= @page_title || 'Page Title Placeholder' %>

+ <% # maybe put a flash section here some day, what Bulma calls the Hero component I think %> <%== yield %>
From 57462f98fcfc8fd7f6154025ad0af824e45fceff Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 15:43:52 -0500 Subject: [PATCH 03/13] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca3abc2..8012f40 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ Run the bundle install command from the project's root directory ``` sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ -bundle config set --local path 'vendor/bundle' +echo 'gem: --no-document' >> ~/.gemrc +sudo cp ~/.gemrc /root/ +bundle config set --global path 'vendor/bundle' +sudo cp -r .bundle /root/ cd my-project bundle install @@ -61,7 +64,8 @@ sudo apt install ruby ruby-dev gcc pkgconf make g++ echo 'gem: --no-document' >> ~/.gemrc sudo cp ~/.gemrc /root/ sudo gem install bundler -bundle config set --local path 'vendor/bundle' +bundle config set --global path 'vendor/bundle' +sudo cp -r .bundle /root/ cd my-project bundle install From 10bcb49b56e4434b5df8d72bd0dd0f206123049f Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 15:50:21 -0500 Subject: [PATCH 04/13] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8012f40..c36f07e 100644 --- a/README.md +++ b/README.md @@ -80,12 +80,18 @@ Todo In the project root directory: ``` +bundle exec puma + +# or if you did not use bundler to install puma... puma ``` This default to development mode. Run it in production mode with: ``` +RACK_ENV=production bundle exec puma + +# or if you did not install puma RACK_ENV=production puma ``` @@ -93,7 +99,7 @@ For development, just run it like that. For production, probably want to set up ### Run it with systemd in production -Copy the example myapp.service file to `/etc/systemd/system/` and edit accordingly. The example assumes a user named "myapp" with a group name "myapp", the application files are in `/opt/myapp/`, and puma is the system puma. +Copy the example myapp.service file to `/etc/systemd/system/` and edit accordingly. The example assumes a user named "myapp" with a group name "myapp", the application files are in `/opt/myapp/`, and puma is the system puma. If you installed puma with bundler, the exe will be at `/opt/myapp/vendor/bundle/ruby/3.1.0/bin/puma`. ### Notes From 3d679586d80a3763f4fa6844ad9c2981fccf510f Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 16:59:26 -0500 Subject: [PATCH 05/13] Update views/greeting.erb --- views/greeting.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/greeting.erb b/views/greeting.erb index 9de747b..15c8d7a 100644 --- a/views/greeting.erb +++ b/views/greeting.erb @@ -1,3 +1,3 @@ -

+

Hello, <%= @name %>!

From 15e6c8dff89f251974bb01bf87c83e3c14654287 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 17:00:55 -0500 Subject: [PATCH 06/13] Update views/index.erb --- views/index.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/index.erb b/views/index.erb index 31b3b2d..25704e6 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,3 +1,3 @@ -

+

Welcome to my new page! Running in <%= ENV['RACK_ENV'] %> mode!

From 9f00a34f7db27f465046ef3e62be01d2b41f5dad Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 17:01:38 -0500 Subject: [PATCH 07/13] Update views/layout.erb --- views/layout.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/views/layout.erb b/views/layout.erb index 3ab9311..b18438a 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -9,8 +9,9 @@
-

<%= @page_title || 'Page Title Placeholder' %>

- <% # maybe put a flash section here some day, what Bulma calls the Hero component I think %> +

+ <%= @page_title || 'Page Title Placeholder' %> +

<%== yield %>
From 4f3d003a35529d61c98d1f942dca0ebe7b478f66 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 1 Nov 2024 17:03:48 -0500 Subject: [PATCH 08/13] Update views/users.erb --- views/users.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/users.erb b/views/users.erb index 13cc1e7..7fd2caf 100644 --- a/views/users.erb +++ b/views/users.erb @@ -1,5 +1,5 @@ <% for u in @users do %> -

+

Hello, <%= u.name %>! You're #<%= u.id %>!

<% end %> From 0cd5093976a73f793a182b12894d827385775fb5 Mon Sep 17 00:00:00 2001 From: james Date: Sat, 2 Nov 2024 22:36:20 -0500 Subject: [PATCH 09/13] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cb44c0a..4530e79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.rake_tasks~ /temp.db +/vendor/ \ No newline at end of file From 2024a8367bc31fca7ae044ed063fce1c2a9ec074 Mon Sep 17 00:00:00 2001 From: james Date: Sat, 2 Nov 2024 23:08:12 -0500 Subject: [PATCH 10/13] link to latest bulma 1.x --- views/layout.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/layout.erb b/views/layout.erb index b18438a..4869da1 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -4,7 +4,7 @@ <%= @page_title || "My Website" %> - +
From a9f4b05b1625c0616b48d80ab652fd82757bb571 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 4 Nov 2024 23:25:40 -0600 Subject: [PATCH 11/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c36f07e..aee5c23 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ cd my-project Run the bundle install command from the project's root directory ``` -sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ +sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ libyaml-dev echo 'gem: --no-document' >> ~/.gemrc sudo cp ~/.gemrc /root/ bundle config set --global path 'vendor/bundle' @@ -60,7 +60,7 @@ bundle install Similar to above but might as well use the gem install to get the latest bundler. The Debian apt packaged bundler is currently a bit outdated and missing some features compared to the latest. ``` -sudo apt install ruby ruby-dev gcc pkgconf make g++ +sudo apt install ruby ruby-dev gcc pkgconf make g++ libyaml-dev echo 'gem: --no-document' >> ~/.gemrc sudo cp ~/.gemrc /root/ sudo gem install bundler From 77bdebd0b1be71f8856ad9c59e780a920cde1097 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 7 Nov 2024 17:46:21 -0600 Subject: [PATCH 12/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aee5c23..7994bbc 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ cd my-project Run the bundle install command from the project's root directory ``` -sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ libyaml-dev +sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ libyaml-dev libffi-dev echo 'gem: --no-document' >> ~/.gemrc sudo cp ~/.gemrc /root/ bundle config set --global path 'vendor/bundle' @@ -60,7 +60,7 @@ bundle install Similar to above but might as well use the gem install to get the latest bundler. The Debian apt packaged bundler is currently a bit outdated and missing some features compared to the latest. ``` -sudo apt install ruby ruby-dev gcc pkgconf make g++ libyaml-dev +sudo apt install ruby ruby-dev gcc pkgconf make g++ libyaml-dev # zlib1g-dev libffi-dev #(for rails stuff) echo 'gem: --no-document' >> ~/.gemrc sudo cp ~/.gemrc /root/ sudo gem install bundler From f4780106996c444622d36e2b8d41ca6a86f87643 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 25 Jun 2025 22:42:56 -0500 Subject: [PATCH 13/13] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4530e79..aa03a48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.rake_tasks~ /temp.db -/vendor/ \ No newline at end of file +/vendor/ +/bin/ \ No newline at end of file