Compare commits
No commits in common. "main" and "roda-sequel" have entirely different histories.
main
...
roda-seque
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,2 @@
|
||||||
/.rake_tasks~
|
/.rake_tasks~
|
||||||
/temp.db
|
/temp.db
|
||||||
/vendor/
|
|
||||||
/bin/
|
|
||||||
54
README.md
54
README.md
|
|
@ -14,17 +14,6 @@ Next Roda app template iterations will add database, then authentication.
|
||||||
|
|
||||||
## Setup
|
## 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
|
### 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.
|
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.
|
||||||
|
|
@ -36,62 +25,29 @@ 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 apt install ruby ruby-rack puma ruby-erubi ruby-tilt ruby-sequel ruby-sqlite3 rake
|
||||||
sudo gem install roda rack-unreloader
|
sudo gem install roda rack-unreloader
|
||||||
|
|
||||||
cd my-project
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Option 2a: Bundler system package
|
#### Option 2: Bundler
|
||||||
|
|
||||||
Run the bundle install command from the project's root directory
|
Run the bundle command from the project's root directory
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt install ruby ruby-bundler ruby-dev gcc pkgconf make g++ libyaml-dev libffi-dev
|
sudo apt install ruby ruby-bundler
|
||||||
echo 'gem: --no-document' >> ~/.gemrc
|
bundle config set --local path 'vendor/bundle'
|
||||||
sudo cp ~/.gemrc /root/
|
|
||||||
bundle config set --global path 'vendor/bundle'
|
|
||||||
sudo cp -r .bundle /root/
|
|
||||||
|
|
||||||
cd my-project
|
|
||||||
bundle install
|
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++ libyaml-dev # zlib1g-dev libffi-dev #(for rails stuff)
|
|
||||||
echo 'gem: --no-document' >> ~/.gemrc
|
|
||||||
sudo cp ~/.gemrc /root/
|
|
||||||
sudo gem install bundler
|
|
||||||
bundle config set --global path 'vendor/bundle'
|
|
||||||
sudo cp -r .bundle /root/
|
|
||||||
|
|
||||||
cd my-project
|
|
||||||
bundle install
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Option 3: Rbenv Ruby
|
|
||||||
|
|
||||||
Todo
|
|
||||||
|
|
||||||
## Run it
|
## Run it
|
||||||
|
|
||||||
In the project root directory:
|
In the project root directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
bundle exec puma
|
|
||||||
|
|
||||||
# or if you did not use bundler to install puma...
|
|
||||||
puma
|
puma
|
||||||
```
|
```
|
||||||
|
|
||||||
This default to development mode. Run it in production mode with:
|
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
|
RACK_ENV=production puma
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -99,7 +55,7 @@ For development, just run it like that. For production, probably want to set up
|
||||||
|
|
||||||
### Run it with systemd in production
|
### 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. If you installed puma with bundler, the exe will be at `/opt/myapp/vendor/bundle/ruby/3.1.0/bin/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.
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<p class="subtitle">
|
<p class="subtitle is-3">
|
||||||
Hello, <%= @name %>!
|
Hello, <%= @name %>!
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<p class="subtitle">
|
<p class="subtitle is-3">
|
||||||
Welcome to my new page! Running in <%= ENV['RACK_ENV'] %> mode!
|
Welcome to my new page! Running in <%= ENV['RACK_ENV'] %> mode!
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title><%= @page_title || "My Website" %></title>
|
<title><%= @page_title || "My Website" %></title>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1/css/bulma.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="title">
|
<h1 class="title is-1"><%= @page_title || 'Page Title Placeholder' %></h1>
|
||||||
<%= @page_title || 'Page Title Placeholder' %>
|
<% # maybe put a flash section here some day %>
|
||||||
</h1>
|
|
||||||
<%== yield %>
|
<%== yield %>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<% for u in @users do %>
|
<% for u in @users do %>
|
||||||
<p class="subtitle">
|
<p class="subtitle is-3">
|
||||||
Hello, <%= u.name %>! You're #<%= u.id %>!
|
Hello, <%= u.name %>! You're #<%= u.id %>!
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue