-
Notifications
You must be signed in to change notification settings - Fork 786
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
Ruby Gem Installation using asdf doesn't work with ZSH #837
Comments
Hi @jctbog9 I'm sorry you're running into this issue often. The issue here is specifically
The asdf core team did not create the Brew Formula and unfortunately have been declined to get the brew installation of asdf to log further steps to users. See #785 and Homebrew/homebrew-core#54315 From the order of steps you describe I assume this is what you experienced:
Unfortunately, because Hopefully now it is clear this isn't an issue specific to Ruby or Gems, but more asdf setup of which there is a history of issues with brew installations and the knowledge transfer that asdf requires further steps than brew performs. Regarding your suggestion to automatically setup asdf after some questions to the user, we (asdf core) have found that our user base have such diverse system configurations that automatically configuring asdf is too much work and involve too many concessions in areas we think are security concerns for users. Feel free to reopen should you not feel the root cause is addressed :) |
Has this issue been solved so far? |
When installing asdf on a new machine, I always run into the problem of the ruby gem installation path not being set up properly with asdf. I use ZSH and am always having to run through documentation trying to figure out how to fix this problem after installing and setting up asdf.
The error that pops up when trying to run
gem install
iswhere it is trying to write directly to the machine's directory for the core mac ruby, rather than asdf's version of it.
I was able to fix this by modifying the path as the documentation suggests by running
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.zshrc
but what I had to research a bit more was that I also needed to add a.tool-versions
file to my home directory manually and also manually add the specific ruby version I wanted to run/make changes to.ruby 2.7.1
Would it be possible to either:
a) make the docs a bit clearer when selecting the desired instructions for installation by stating something like "You may encounter issues with gem installation paths in newer versions of MacOS even after reshim, if so please reference these docs here" when the user selects the ZSH option? Similar to the below warning screenshot?
or
b) add a fetaure to the asdf cli that includes the option
fix_ruby
or something that asks the user what type of shell they are using and then changes the paths automatically based on user input in the terminal (> zsh)? Similar to how NuxtJS CLI asks for input before creating a new app (i.e. which frontend css framework you'd like preinstalled and which testing framework you want preinstalled as well)Just an idea I had but this comes up every time when using asdf on a new machine and trying to work with ruby gems so I figured I'd raise the suggestion here :)
The text was updated successfully, but these errors were encountered: