Comments (13)
@crsantos @hoangtranwork I was having a similar problem to the one described above when installing via homebrew and having rbenv
previously installed. I noticed I was missing the asdf configurations in my ~/.zshrc
file that you are suppose to add during setup
I uninstalled rbenv via homebrew and then ran the following commands and it seems to have fixed the problem, I'm now using the proper version of ruby globally. Hopefully this is helpful, obviously it changes slightly depending on your shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.zshrc
echo -e "\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash" >> ~/.zshrc
source ~/.zshrc
from asdf-ruby.
For someone how's coming here from Google, consider this scenario I had (macOS):
While installing asdf install ruby latest
I accidentally quit the terminal where the command was running although on coming back I found asdf
pretty sure that the latest ruby version was successfully installed, showing it as current and so on, but not actually changing it globally. I tried everything (adding asdf.sh
higher in my ~/.zshrc
), reshim
, etc. β nothing helped. And then I realized that actually Ruby installation has never been finished and asdf
seems to register the version before it's actually compiled and installed. The solution in such case is trivial:
asdf uninstall ruby 3.1.2 # or whichever version you have
asdf install ruby latest # and wait till it's indeed installed
asdf global ruby latest #
ruby -v # should be the latest version, not the system one
from asdf-ruby.
@jrusso1020's solution almost worked for me, but I noticed that the asdf
website's getting started instructions are slightly different (now, at least) for ZSH and Homebrew:
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
from asdf-ruby.
It depends on whether or not you were in a sub directory that had a local ruby version set. If you were in a sub directory with a .tool-versions
file containing ruby 2.3.7
, or a .ruby-version
file containing 2.3.7
that is the expected behavior. If you didn't have local version set and were in your home directory then there is an issue.
from asdf-ruby.
Could it be that you also have ruby
installed via Homebrew (I think for instance using vim
from Homebrew will install it) and therefore this executable earlier in your $PATH
@crsantos ?
You could quickly check
brew list |Β grep ruby
At least for me this also prevented asdf-ruby
from working rbenv-ish. Aside that, I think using the Homebrew version also has the downside that you'll have to manually move all your plugins when upgrading the package via Homebrew π€
from asdf-ruby.
Brew has become an "official" way of installing it too, so if you can identify a specific scenario where it breaks please reopen this issue (type -a ruby
is your friend).
from asdf-ruby.
FYI I also have the exact same issue (and the workaround by installing with git instead of brew works).
One thing I notice when installing with brew is that there's no such asdf.sh file (to be put in .zshrc). Maybe that is the catch with installing with brew.
from asdf-ruby.
I'm on my $HOME ~/
and I only have a .tool-versions
here with with following content:
ruby 2.4.1
python 3.7.1
I have a folder with a local .ruby-version
and even a .tool-versions
set to 2.4.1
, but even using the legacy_version_file = yes
, I don't have 2.4.1 enabled on that folder.
I just don't know if this is an issue, or some "trash" config that I have left from rbenv, but I'm pretty sure I'm not loading rbenv at all.
Changed to fishshell.com, so my configs are new.
Any other idea?
from asdf-ruby.
I'm seeing a pattern here.
Installing via Homebrew I have this problem, but git cloning the 0.6.0
branch directly, it works just fine.
So I'm removing the Homebrew installation and using a local git folder instead.
Not sure you want me to debug anything else, but the local git folder is perfectly fine for me, and homebrew installation is not listed on the README
, so I assume this makes it unofficial π
EDIT: I'm going to close this issue since it's working fine following the README.
from asdf-ruby.
I suspect there could possible be a rbenv or system installed Ruby that is on your path before asdf. Maybe the homebrew path comes after the path containing system installed ruby, but when you switc to git installed asdf it comes before system installed ruby? I'm fairly certain this is working correctly, at least for the most widely used cases.
from asdf-ruby.
I'll install from brew again tomorrow and will come back with more conclusions π
Standby and thank you!
from asdf-ruby.
I have some new output when turning on the brew asdf-vm.
Beware that I added this to config.fish
:
source /usr/local/Cellar/asdf/*/asdf.fish
- to match the
source
command when using the git folder:source ~/.asdf/asdf.fish
) - is that my problem?
$ which asdf
/usr/local/Cellar/asdf/0.6.0/bin/asdf
$ asdf where ruby
/Users/crsantos/.asdf/installs/ruby/
$ asdf which ruby
/Users/crsantos/.asdf/installs/ruby/2.4.1/bin/ruby
$ asdf global ruby 2.4.1
$ ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
$ type -a ruby
ruby is /usr/bin/ruby
asdf.fish
files are identical, even the permissions! Same user, only the group is different.
$ ls -l /usr/local/Cellar/asdf/*/asdf.fish
-rw-r--r-- 1 crsantos admin 283B Oct 8 03:31 /usr/local/Cellar/asdf/0.6.0/asdf.fish
$ ls -l ~/.asdf/asdf.fish
-rw-r--r-- 1 crsantos 1052847317 283B Oct 29 21:57 /Users/ricardo.santos/.asdf/asdf.fish
Enabling the git one again, fixes the PATH
, and all works: π€·ββοΈ
$ type -a ruby
ruby is /Users/crsantos/.asdf/shims/ruby
ruby is /usr/bin/ruby
from asdf-ruby.
Well, I guess I just have ruby-build
:
$ brew list | grep ruby
ruby-build
But I suppose that's normal, right?
So out of ideas π€
Thanks for the input.
from asdf-ruby.
Related Issues (20)
- Failed to install Ruby 3.1.4 on Ubuntu 22.04
- Issue installing ruby 3.2.X HOT 1
- Failed to install ruby 3.2.1 on M1 Pro with macOS Ventura 13.3 and macOS 14.0
- Observe ASDF_CONCURRENCY HOT 3
- rbenv install faild with whitespace in `$ASDF_DATA_DIR`
- Getting BUILD FAILED (macOS 13.2.1 on arm64 using ruby-build 20231114) using M2 Macbook on Ventura 13.2.1 HOT 2
- Failed to upgrade Ruby version from 3.2.2 to 3.3.0 using asdf HOT 2
- build fail for ruby 3.3.0 on Apple M2 Max silicone and sonoma 14.2.1 (23C71) HOT 2
- Add Ruby 3.2.3 HOT 2
- asdf does not seem to be picking up on ruby gem executables in the GEM_PATH HOT 7
- "Downloaded files will not be preserved." HOT 1
- Ruby 3.2.3 cannot be installed on Ubuntu 22.04 HOT 2
- Build failed: `psych` Could not be configured. It will not be installed. HOT 3
- Truffle Ruby Latest? HOT 1
- The same OS and asdf version on 2 different machines shows different recent ruby versions to install HOT 4
- asdf in background HOT 4
- Question: can the same version be installed twice with diff name? HOT 3
- Auto-reshim is broken when using the asdf-alias plugin
- Failed to install ruby 3.1.5 on Mac OS 13.6.6 M2 Pro
- Where is ruby 3.3.4?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asdf-ruby.