All about coding

Ruby and Rails technical content written by Lucian Ghinda

Shortfix: When updating Dockerfile to use ruby3.0.3-alpine pin alpine to alpine3.13

#ruby #ruby-on-rails #docker #bugs-and-errors #howtos

If you update your Dockerfile to use ruby:3.0.3-alpine and notice the following error while building the image:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/bundle directory.

First know that 3.0.3-alpine actually is using alpine3.14.

The fix is to pin the alpine version to 3.13 so use in your Dockerfile:

FROM ruby:3.0.3-alpine3.13

Why this happens:

Seems like something changed in alpine3.14 and bundle cannot write in /usr/local/bundle.

Multiple people had this issue:

It seems to be related to Docker Version running the Dockerfile:

View posts by tag

#ruby #concurrency #general-advice #life-hack #ruby-on-rails #google-cloud #kubernetes #bash #apis #rest-api #guide #docker #bugs-and-errors #howtos #newbie #programming-languages #programming-tips #til #coding #learning #postgresql #sql #design-patterns #web-api #programming-blogs #programmer #databases #programming #learn-coding #learning-journey #side-project #coding-challenge #design-principles #solid-principles #git #tips #testing #test-driven-development #test-automation #code #shortpost #refactoring #code-review #rails #developer #documentation #focus #blogging #content-creation #share #advice #newsletter #active-record #ai #ai-tools #generative-ai #web-development #errors #cursor-ide #ides #gpt-4 #news #scalability #tailwind-css #chatgpt #opensource #reviews #startups #github #technology #types #sorbet #performance #rubymine #vscode #codesnippet #features #syntax #friendlyrb #conference #directories #writing #summary #animation #articles #podcasts #publishing #patterns #pattern-matching #content #updates #seo-for-developers #marketing #properties #gems #matching #rspec #llm #tools #lsp #claudeai #opencode #mcp #rubocop #quality #planning #products #mvp #upgrade #agentic-ai #skills #superpowers