Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RVM setup #90

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.2.2

- name: rubocop
uses: reviewdog/[email protected]
Expand Down Expand Up @@ -59,11 +59,11 @@ jobs:
with:
fetch-depth: 0

- name: Set up Ruby 3.0.2
- name: Set up Ruby 3.2.2
id: ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
ruby-version: 3.2.2
bundler-cache: true

- name: Install required package
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

source 'https://rubygems.org'

ruby '3.0.2'
ruby '3.2.2'

# Token
gem 'jwt', '2.2.2'
Expand All @@ -26,11 +26,12 @@ gem 'rack', '2.1.4'
gem 'otr-activerecord', '2.0.3'

# PostgreSQL adapter
gem 'pg', '1.2.3'
gem 'pg', '1.5.6'

gem 'netrc'

gem 'puma', '5.5.2'
gem 'puma-metrics', '1.2.5'

gem 'rake', '13.0.6'

Expand Down
12 changes: 9 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ GEM
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pg (1.2.3)
pg (1.5.6)
prometheus-client (4.2.2)
prometheus-client (4.2.2)
public_suffix (5.0.3)
puma (5.5.2)
nio4r (~> 2.0)
puma-metrics (1.2.5)
prometheus-client (>= 0.10)
puma (>= 5.0)
racc (1.7.1)
rack (2.1.4)
rack-protection (2.0.8.1)
Expand Down Expand Up @@ -164,8 +169,9 @@ DEPENDENCIES
netrc
octokit (<= 4.17.0)
otr-activerecord (= 2.0.3)
pg (= 1.2.3)
pg (= 1.5.6)
puma (= 5.5.2)
puma-metrics (= 1.2.5)
rack (= 2.1.4)
rack-test
rake (= 13.0.6)
Expand All @@ -177,7 +183,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.0.2p107
ruby 3.2.2p107

BUNDLED WITH
2.4.7
43 changes: 37 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ Ensure you have the following installed on your system:
2. **Create a Database**:
After installing PostgreSQL, create a new database for the project. You can do this using the `psql` command-line tool or any PostgreSQL client.

```bash
```bash
RAKE_ENV=development psql -c "CREATE DATABASE github_hook_server_development;"
```
```
3. **Configure Database Connection**:
Update the `config/database.yml` file with the database connection details. You can use the following configuration as a template:

```yaml
```yaml
development:
adapter: postgresql
encoding: unicode
Expand All @@ -77,22 +77,53 @@ Ensure you have the following installed on your system:
password: password
host: localhost
port: 5432
```
```

Replace the `username`, `password`, `host`, and `port` values with your PostgreSQL connection details.

4. **Run Database Migrations**:
After configuring the database, run the database migrations to set up the necessary tables and schema.
```bash
```bash
bundle exec rake db:migrate
```
```

5. **Verify the Configuration**:
Start the application and verify that it can connect to the database without any errors.
```bash
RAILS_ENV=development rackup -o 0.0.0.0 -p 9292 config.ru
```

### RVM

RVM (Ruby Version Manager) is a command-line tool that allows you to easily install, manage, and work with multiple Ruby environments. This guide will walk you through the steps to install and use RVM on Debian 12.

#### Installation Steps

1. Update System Packages: Ensure your system packages are up-to-date. ```sudo apt update sudo apt upgrade -y```
2. Install Required Dependencies: Install the necessary dependencies for RVM. ```sudo apt install -y curl gpg```
3. Import GPG Keys: Import the GPG keys required for RVM.```gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB```
4. Install RVM: Download and install RVM.```\curl -sSL https://get.rvm.io | bash -s stable```
5. Load RVM Script: Load the RVM script into your shell session. ```source ~/.rvm/scripts/rvm```
6. Add User to RVM Group: Add your user to the RVM group to manage Ruby versions. ```sudo usermod -aG rvm $USER```
7. Restart Terminal: Close and reopen your terminal or log out and log back in to apply the group changes.
8. Verify RVM Installation: Verify that RVM is installed correctly. ```rvm --version```

#### Usage

1. Install Ruby: Use RVM to install a specific version of Ruby. ```rvm install 3.2.2```
2. Set Default Ruby Version: Set the default Ruby version for your environment. ```rvm use 3.2.2 --default```
3. Check Ruby Version: Verify the installed Ruby version. ```ruby -v```
4. Install Bundler: Install Bundler for managing gem dependencies. ```gem install bundler```

#### Notes

- To list all available Ruby versions, use rvm list known.
- To switch between installed Ruby versions, use rvm use <version>.
- For more detailed usage and options, refer to the RVM documentation.

This guide provides the basic steps to get started with RVM on Debian 12. For advanced usage and troubleshooting,
refer to the official RVM documentation.

# Usage

### Production
Expand Down
Loading