rails: No such file or directory - /usr/src/app/bin/yarn
Steps to reproduce
When I run bin/rails assets:precompile
I get a Errno::ENOENT
exception. Probably related to https://github.com/rails/rails/pull/40739.
Expected behavior
I expect the precompilation of assets to fallback to existing yarn when not found in bin
directory.
Actual behavior
RUN RAILS_ENV=production bin/rails assets:precompile
rails aborted!
Errno::ENOENT: No such file or directory - /usr/src/app/bin/yarn
Tasks: TOP => assets:precompile => yarn:install
System configuration
Rails version: 6.1.0
Ruby version: 2.7.2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 21 (5 by maintainers)
Commits related to this issue
- Fix yarn issue during deploy When running `rake assets:precompile`, `railties-6.1.0/lib/rails/tasks/yarn.rake` gets called and since we don't have yarn installed it will cause an exception. There is... — committed to barsoom/pipeline by deleted user 4 years ago
- Add an error message in case `bin/yarn` is missing One reason why it could be missing because Rails was upgraded but `rails app:update` was not run. Running `rails app:update:bin` should create it. ... — committed to Stellenticket/rails by doits 4 years ago
- Only run `yarn:install` before `assets:precompile` if `bin/yarn` present Based on discussion in https://github.com/rails/rails/issues/40795, it looks like `yarn:install` is *always* run, even if the ... — committed to Stellenticket/rails by doits 4 years ago
- refactor: rails 从 6.1.0 回滚 6.0.3.4 rails/rails#40795 — committed to tryzealot/zealot by icyleaf 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
- Fixed No such file or directory - /usr/src/app/bin/yarn https://github.com/rails/rails/issues/40795 — committed to spark-solutions/spree by damianlegawiec 4 years ago
@AnthonyFrancis looks like Rails 6.1.1 was just released and it includes the fix for
yarn:install
As a temporary fix, you can add the following to your Rakefile:
@KevinBongart fix was merged https://github.com/rails/rails/pull/40785, no need for open issue anymore.
@mukinabis see https://github.com/barsoom/pipeline/commit/3906724b34b4803d815f9ab1252b6046d00b8821 where the rake task is overwritten to do nothing
We are still using sprockets to compile javascripts and we are getting the same error. It is was caused by this change https://github.com/rails/rails/pull/40722 (https://github.com/rails/rails/commit/b087511bc49097a6dc2afe0256bb6d39ebb3a4ab)
full stack trace:
system
call swallows the problem and returnsnil
if command doesn’t exist. Backgticks `` on the other hand raises an exception. That is the reason it is raising exceptions.It worked fine in 6.1.0.rc2, it was broken by final release.