admin管理员组文章数量:1387352
I build a Docker image from the ruby:3.2.3-bullseye
image for a Rails 6.1 project. I install yarn via apt-get (among others), copy the source code and later compile the assets
curl -sS .gpg | apt-key add && \
echo "deb / stable main" > /etc/apt/sources.list.d/yarn.list &&\
apt-get install -y yarn nano cron nodejs
The images gets built all right, but every time when compiling assets
rails assets:precompile
I get notified
yarn: no such option: --immutable
I've searched my project for that string, but I can't find it. Who calls yarn with this option?
It's not very important as the assets get compiled successfully, but it makes me nervous, and I'd like to understand what is happening.
I build a Docker image from the ruby:3.2.3-bullseye
image for a Rails 6.1 project. I install yarn via apt-get (among others), copy the source code and later compile the assets
curl -sS https://dl.yarnpkg/debian/pubkey.gpg | apt-key add && \
echo "deb https://dl.yarnpkg/debian/ stable main" > /etc/apt/sources.list.d/yarn.list &&\
apt-get install -y yarn nano cron nodejs
The images gets built all right, but every time when compiling assets
rails assets:precompile
I get notified
yarn: no such option: --immutable
I've searched my project for that string, but I can't find it. Who calls yarn with this option?
It's not very important as the assets get compiled successfully, but it makes me nervous, and I'd like to understand what is happening.
Share Improve this question edited Apr 2 at 11:17 MDickten asked Mar 17 at 10:22 MDicktenMDickten 1601 silver badge12 bronze badges 1 |2 Answers
Reset to default 1There are different yarns
https://packages.debian./bullseye/yarn (cmdtest, what you installed)
https://packages.debian./bullseye/yarnpkg (JS package manager, what you need)
You need to uninstall current yarn and install correct one
As example this way
curl -sS https://dl.yarnpkg/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
If you use Docker, you should use such command
RUN curl -sS https://dl.yarnpkg/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt update && \
apt install -y yarn
It's basic command, of course you can add other packages to install command, drop package lists after installation, etc.
Brief explanation:
- Add correct repository
- Update package lists
- Install correct package
Also read more about yarn installation in the official docs
https://classic.yarnpkg/en/docs/install#debian-stable
You must update package lists after adding new repository. Otherwise apt is not aware of the new repository yet when installing yarn.
If you want to continue using Yarn 1.x, replace --immutable with --frozen-lockfile
, which is the equivalent option for that version.
本文标签: rails assetsprecompile gives yarn no such option immutable (Rails 6Ruby 3)Stack Overflow
版权声明:本文标题:rails assets:precompile gives yarn no such option immutable (Rails 6, Ruby 3) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744567751a2613156.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
which yarn
:/usr/bin/yarn
– MDickten Commented Mar 18 at 12:07