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

Update to Ruby 3 #624

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c8d8be2
Bump npm to 7.0.0
johnpaulashenfelter Jul 28, 2023
891baec
Lock CI npm to valid version
johnpaulashenfelter Jul 28, 2023
797c199
Add phantomjs to frontend GHA workflow
johnpaulashenfelter Jul 28, 2023
a6e9505
Try putting in ~bin
johnpaulashenfelter Jul 28, 2023
5dc914c
Try ubuntu packaged phantomjs
johnpaulashenfelter Jul 28, 2023
55e4ad5
Add phantomjs as prebuilt
johnpaulashenfelter Jul 28, 2023
abae3f5
Remove phantomjs apt install
johnpaulashenfelter Jul 28, 2023
81953ee
Update README.md
freestylebit Jul 28, 2023
b773afd
Remove old Airbrake references
johnpaulashenfelter Jul 28, 2023
43557e9
Remove unused UserEngage api key
johnpaulashenfelter Jul 28, 2023
4d8b373
Update README.md #3
freestylebit Jul 28, 2023
0e1de83
Merge pull request #2 from bglusman/jp/cleanup-env
bglusman Jul 28, 2023
7e0b24c
Merge pull request #1 from bglusman/r4g/update-npm
bglusman Jul 28, 2023
cce6777
Update to Ruby 3
bglusman Jul 28, 2023
a19818a
run standardrb
bglusman Jul 28, 2023
aa19d1e
Try checkout@v3
bglusman Jul 28, 2023
10cf0b6
Try checkout@v3 everywhere
bglusman Jul 28, 2023
6248848
fix versioning duplication
bglusman Jul 28, 2023
b5b3093
disable bundler cache for now
bglusman Jul 28, 2023
4387c43
Add services to .tool-versions
solebared Jul 28, 2023
770f2b6
Use symlink for backend copies
bglusman Jul 28, 2023
aed5495
Go back to checkout @2.3.4
bglusman Jul 28, 2023
707710e
specify ruby version in setup
bglusman Jul 28, 2023
2623156
missed Gemfile.lock change
bglusman Jul 28, 2023
d3ab55a
Undo explicit setup-ruby versions
bglusman Jul 28, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
services:
redis:
image: redis:6.2.3-alpine
ports: ['6379:6379']
ports: ["6379:6379"]
options: --entrypoint redis-server

db:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm install -g npm@latest
- run: npm install -g npm@7.0.0
- run: npm install
working-directory: ./frontend
- run: npm run test
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.0.6
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nodejs 12.22.6
ruby 3.0.6
postgres 12.8
mongodb 4.4.9
redis 6.2.3
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ Help would be appreciated! Please join us in [slack #flaredown](https://rubyforg
* Redis 6.2.3
* Ruby 2.7.4 (see [RVM](https://rvm.io/) also)
* Node 12.22.6
## Installation

You can spin up instances of the required data-stores in Docker containers using `docker compose up` in the project root.

On macOS, you can install libpq by running `brew install libpq && brew link --force libpq && bundle config --local build.pg "--with-ldflags=-L$(brew --prefix libpq)/lib --with-pg-include=$(brew --prefix libpq)/include"`, which is required for `bundle install` to succeed.
_If you are running on an M1 mac, run the following command before you start the installation process:_
```bash
$env /usr/bin/arch -arm64 /bin/zsh ---login
```

## Installation
_Remove all gems before you proceed_
```bash
gem uninstall -aIx
```

### Backend

On macOS, you can install libpq by running `brew install libpq && brew link --force libpq && bundle config --local build.pg "--with-ldflags=-L$(brew --prefix libpq)/lib --with-pg-include=$(brew --prefix libpq)/include"`, which is required for `bundle install` to succeed.

```bash
cd backend
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
Expand All @@ -34,6 +41,8 @@ bundle install
cp env-example .env # You may adjust it however you like
# RVM is going to autoload this on every 'cd' to the directory
bundle exec rake app:setup

gem install foreman
```

### Frontend
Expand All @@ -45,6 +54,11 @@ npm install

## Running / Development

From the project root:
```bash
docker compose up
```

```bash
rake run
```
Expand Down
1 change: 0 additions & 1 deletion backend/.ruby-version

This file was deleted.

1 change: 1 addition & 0 deletions backend/.ruby-version
1 change: 1 addition & 0 deletions backend/.tool-versions
23 changes: 11 additions & 12 deletions backend/Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
source "https://rubygems.org"

ruby "2.7.4"
ruby "3.0.6"

# Configuration management. keep on top of Gemfile
gem "dotenv-rails", groups: [:development, :test]
gem "dotenv-rails", groups: %i[development test]

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 6.1.4.1"
Expand All @@ -13,16 +13,16 @@ gem "rake"
gem "active_model_serializers", "0.9.8"

# Use postgresql and mongo as the database for Active Record
gem "pg", "1.2.3"
gem "mongoid", "7.3.3"
gem "pg", "1.2.3"

# Use Puma as the app server
gem "puma", "5.6.4"

# Authentication libraries
gem "devise", "4.8.0"
gem "cancancan", "~> 3.3.0"
gem "cancancan-mongoid", "2.0.0"
gem "devise", "4.8.0"
gem "devise_invitable", "2.0.5"
gem "omniauth", "1.8.1"
gem "omniauth-facebook", "3.0.0"
Expand Down Expand Up @@ -58,8 +58,8 @@ gem "symmetric-encryption"

gem "ruby-progressbar", require: false

gem "kaminari-mongoid"
gem "kaminari-actionview"
gem "kaminari-mongoid"
gem "rack-cors", "1.1.1", require: "rack/cors" # freezing to gemfile.lock version because heroku is not respecting lockfile
gem "simplecov", require: false, group: :test

Expand All @@ -73,36 +73,35 @@ group :development, :test do
gem "factory_bot_rails"
# Generate Fake data
gem "ffaker"
gem "rspec-rails", "~> 4.1.0"
gem "pry-rails"
gem "pry-byebug"
gem "pry-doc"
gem "pry-rails"
gem "rspec-rails", "~> 4.1.0"
gem "standardrb"
end

group :development do
gem "annotate"
gem "awesome_print", "~>1.6"
gem "better_errors", "~>2.1"
gem "binding_of_caller", "~>0.7"
gem "foreman", require: false
gem "letter_opener"
gem "rubocop-rails", require: false
end

group :test do
gem "shoulda-matchers"
gem "mongoid-rspec"
gem "webmock"
gem "vcr"
gem "shoulda-matchers"
gem "timecop" # travel_to isn't working? TODO figure this out
gem "vcr"
gem "webmock"
end

group :production do
gem "rails_12factor"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]

gem "bugsnag", "~> 6.22"
8 changes: 2 additions & 6 deletions backend/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ GEM
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bson (4.12.1)
bson (4.12.1-java)
bugsnag (6.24.0)
Expand Down Expand Up @@ -120,7 +118,6 @@ GEM
database_cleaner-mongoid (2.0.1)
database_cleaner-core (~> 2.0.0)
mongoid
debug_inspector (1.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.8.0)
Expand Down Expand Up @@ -451,7 +448,6 @@ DEPENDENCIES
annotate
awesome_print (~> 1.6)
better_errors (~> 2.1)
binding_of_caller (~> 0.7)
bugsnag (~> 6.22)
bullet
byebug
Expand Down Expand Up @@ -505,7 +501,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 2.7.4p191
ruby 3.0.6p216

BUNDLED WITH
2.2.29
2.2.33
11 changes: 1 addition & 10 deletions backend/env-example
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ LOCALTUNNEL_PORT=4300
FACEBOOK_APP_ID=
FACEBOOK_APP_SECRET=

# Airbrake
AIRBRAKE_ENV=
AIRBRAKE_HOST=
AIRBRAKE_PROJECT_ID=
AIRBRAKE_PROJECT_KEY=

# Discourse
DISCOURSE_ENABLED=false
DISCOURSE_URL=
Expand All @@ -50,9 +44,6 @@ DISCOURSE_SECRET=
INTERCOM_APP_ID=
INTERCOM_SECRET=

# Userengage
USERENGAGE_API_KEY=

# Google ReCaptcha
# https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
Expand All @@ -63,4 +54,4 @@ FULLSTORY_ENABLED=
FULLSTORY_ORG=

# MongoDB
MONGODB_HOST=localhost
MONGODB_HOST=localhost
Loading
Loading