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

Rake task webpacker:compile fails when which is not installed #3338

Open
cbochs opened this issue Jul 18, 2024 · 0 comments
Open

Rake task webpacker:compile fails when which is not installed #3338

cbochs opened this issue Jul 18, 2024 · 0 comments
Labels

Comments

@cbochs
Copy link

cbochs commented Jul 18, 2024

I thought I would report this here instead of shakapacker, since shakapacker hasn't been updated in more than 2 years. It appears that the yarn check depends on which being available on the system for the check to succeed. If it is not, then webpacker:compile fails with a relatively ambiguous error of:

$ bundle exec rake webpacker:compile

Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
Exiting!

This occurs when running ruby/rails on a docker container which does not have which installed by default (e.g. an almalinux image).

Ruby version: 3.0.7
Rails version: 6.1.0
Webpacker version: shakapacker-6.5.2, but this issue is still present in the most recent RC (v6.0.0.rc.6)

Expected behavior:

Webpacker compiles

Actual behavior:

Webpacker fails to compile.

Small, reproducible repo:

$ docker run --rm -it almalinux

# dnf install -y epel-release
# dnf install --enablerepo-crb -y ruby-devel gcc libyaml-devel yarnpkg
# gem install shakapacker -v '6.5.2'

# type which
bash: type: which: not found

# type yarn
yarn is /usr/bin/yarn

# echo 'import "/usr/local/share/gems/gems/shakapacker-6.5.2/lib/tasks/webpacker/check_yarn.rake"' > Rakefile

# rake webpacker:check_yarn
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
Exiting!
@cbochs cbochs added the bug label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant