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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing psych (5.1.2) when creating DockerFile with Rails 7.1.2 #74

Closed
berkos opened this issue Dec 22, 2023 · 0 comments 路 Fixed by #75
Closed

Error installing psych (5.1.2) when creating DockerFile with Rails 7.1.2 #74

berkos opened this issue Dec 22, 2023 · 0 comments 路 Fixed by #75
Assignees

Comments

@berkos
Copy link

berkos commented Dec 22, 2023

馃憢 Thanks for your contribution.

Issue:
I have a new Rails 7.1.2 which after the creation of the app I deleted the default DockerFile that comes with Rails 7.1.x
and run the command.

bin/rails generate dockerfile --fullstaq --jemalloc

Then when I tried to check that the image builds with

docker build .

I got this error.

23.69 An error occurred while installing psych (5.1.2), and Bundler cannot continue.
23.69 
23.69 In Gemfile:
23.69   importmap-rails was resolved to 1.2.3, which depends on
23.69     railties was resolved to 7.1.2, which depends on
23.69       irb was resolved to 1.10.1, which depends on
23.69         rdoc was resolved to 6.6.2, which depends on
23.69           psych

....
....
....

Dockerfile:32
--------------------
 31 |     COPY --link Gemfile Gemfile.lock ./
 32 | >>> RUN bundle install && \
 33 | >>>     bundle exec bootsnap precompile --gemfile && \
 34 | >>>     rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
 35 |     
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c bundle install &&     bundle exec bootsnap precompile --gemfile &&     rm -rf ~/.bundle/ \"${BUNDLE_PATH}\"/ruby/*/cache \"${BUNDLE_PATH}\"/ruby/*/bundler/gems/*/.git" did not complete successfully: exit code: 5

Doing some extra research it turns out that Phych 5.x.x requires libyaml on MacOS and libyaml-dev on ubuntu.
ruby/psych#602

Resolution:

Adding libyaml-dev in the DockerFile builds the image successfully.

Thanks

@rubys rubys self-assigned this Dec 22, 2023
@rubys rubys linked a pull request Dec 22, 2023 that will close this issue
@rubys rubys closed this as completed in #75 Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants