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

[#1][Backend] Setup project #24

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ gem 'jsbundling-rails' # Bundle and transpile JavaScript
gem 'i18n-js', '3.9.0' # A library to provide the I18n translations on the Javascript
# gem 'devise-i18n' # Translations for Devise

gem 'psych', '< 4.0'
# Fix Ruby 3.1 that uses psych version 4.0 and conflicts with rails-template
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment does not reflect the actual situation. What does it mean by "conflicts with rails-template"?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to create a rails app without a template using Ruby 3.2.1 without downgrading Psych to version 3, and everything worked fine. So, I think there will be some issue that does not work properly in the template.

I might be misunderstanding the root issue in this case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean you created the project without using the Rails template, and it worked, right?
It's because Rails template uses the Figaro gem, and it will break if you use Ruby 3.1 and above (which requires psych v4).
So, even if you initialized the project without the Rails template, later, if you add the Figaro gem (or any other gem that depends on psynch but has not been updated to work with psynch v4), it will break again.
Check this issue for more details
nimblehq/rails-templates#316.

So instead of forcing psych < 4.0, I would suggest, either

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also to clarify: in the end, did you use the Rails-template to initialize this project?

gem 'psych', '3.3.4'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the root cause is that Ruby 3.1 comes with psych v4 which is a breaking change. But the gem file here is limiting the version to < 4 already. So why we need to set a specific version 3.3.4?

Copy link
Owner Author

@captainnimble captainnimble Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line gem 'psych', '< 4.0, is that I accidentally committed it with initial commit. I think it can make some confused, so I set it to a specific version to have a clear understanding, and 3.3.4 is the latest version before 4.0.


group :development do
gem 'foreman' # Manage Procfile-based applications
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ DEPENDENCIES
pg
pry-byebug
pry-rails
psych (< 4.0)
psych (= 3.3.4)
puma
pundit
rack-timeout
Expand Down