-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
yarn
shim can't seem to find installed yarn
#1051
Comments
The for ver in $(rbenv whence yarn); do
RBENV_VERSION="$ver" gem uninstall -ax yarn
rm -f "$(rbenv prefix "$ver")/bin/yarn"
done
rbenv rehash
# now check the yarn executable again:
which -a yarn |
This didn't do anything for me. I did some more digging and Because I was in a project dir with no ruby-version file, the shims used are the system shims, right? |
That is definitely possible. But if |
Thanks for the info. I'm pretty sure it's something about my setup. If I find a solution, I can add notes to the ticket. |
I faced this problem too and check installed plugins. I removed https://github.com/ianheggie/rbenv-binstubs and solved it. |
You can also copy |
In my environment, this happens not only rails project directory but anywhere globally. |
@akashani62 you have a typo in your comment: it should be |
I encountered something similar with a different executable. One of the projects I work with has a dependency that adds an executable to the shims of the same name as a system one. When I switch from that project to another one, that uses the system wide executable, I get confused about the errors regularly, until I remember to delete the shim. Not sure how to fix this other than working on consistency between projects, but that's not always an option. |
Anyone who wants to use |
This should be resolved in madumlao/rbenv-binstubs@335a830 (master branch): rbenv-binstubs will now only shim / inject ruby executables. |
For what it's worth, I was able to fix this issue by running |
@PatrickDePuydt, unless your rbenv-binstubs distinguishes between ruby and non-ruby executables, yarn will get picked up again on your next rehash. |
only this works for me. @madumlao do you have some clue about how that is so? |
@waruboy, have you tried forcing a As an update, I've also tried a different approach in madumlao/rbenv-binstubs/unshadow . This is also merged in madumlao/rbenv-binstubs/master rbenv-binstubs will now actively "unshim" if no binstubs are pointed to by any shimmed executables, thus defaulting to whatever system or user-defined paths are defined. This should solve the case where yarn being shimmed inside the project path of one ruby project causes yarn to break everywhere else (rbenv will not use the shim if the yarn executable pointed to by the shim does not exist). However, inside the project path of that ruby project, the yarn shim will still be used. This does not resolve any issues caused by that yarn shim being broken (if it is broken). |
@madumlao thank you for your response. I pulled your latest master and it works! But I just want to make sure if this is expected. When i run
|
Yes, that is expected behavior. You will notice though, that if you run |
@madumlao got it and confirmed! Thanks for your kind explanation |
I've had this problem for a bit. It seems that rbenv can't seem to figure out where
yarn
is. I realize it's a js dependency so i'm not quite sure why rbenv even wants to have a shim for it.I'm in a directory that is a JS only project - so there is no
.ruby-version
, i have the following config:This has also occurred in ruby project directories where there is a
.ruby-version
and I'm using yarn for webpack and other stuff.Any ideas?
The text was updated successfully, but these errors were encountered: