File tree 2 files changed +31
-1
lines changed
2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
10
10
11
11
For a steady stream of TILs, [ sign up for my newsletter] ( https://crafty-builder-6996.ck.page/e169c61186 ) .
12
12
13
- _ 1555 TILs and counting..._
13
+ _ 1556 TILs and counting..._
14
14
15
15
See some of the other learning resources I work on:
16
16
- [ Ruby Operator Lookup] ( https://www.visualmode.dev/ruby-operators )
@@ -1571,6 +1571,7 @@ See some of the other learning resources I work on:
1571
1571
- [ Search History] ( unix/search-history.md )
1572
1572
- [ Search Man Page Descriptions] ( unix/search-man-page-descriptions.md )
1573
1573
- [ Securely Remove Files] ( unix/securely-remove-files.md )
1574
+ - [ See Where asdf Gets Current Tool Version] ( unix/see-where-asdf-gets-current-tool-version.md )
1574
1575
- [ Set The asdf Package Version For A Single Shell] ( unix/set-the-asdf-package-version-for-a-single-shell.md )
1575
1576
- [ Show A File Preview When Searching With FZF] ( unix/show-a-file-preview-when-searching-with-fzf.md )
1576
1577
- [ Show Disk Usage For The Current Directory] ( unix/show-disk-usage-for-the-current-directory.md )
Original file line number Diff line number Diff line change
1
+ # See Where asdf Gets Current Tool Version
2
+
3
+ The other day I [ installed the latest version of
4
+ Ruby] ( ruby/install-latest-version-of-ruby-with-asdf.md ) with ` asdf ` . I then set
5
+ that version (` 3.4.1 ` ) as the global default. However, when I then ran `ruby
6
+ --version` , I was getting a ` 3.2.x` version. I checked my current project's
7
+ directory and there was no ` .tool-versions ` file, so it wasn't being set by my
8
+ current directory.
9
+
10
+ ` asdf ` looks up the current chain of directories until it encounters a
11
+ ` .tool-versions ` file, so it must have been finding one somewhere up there, but
12
+ before it was getting to the _ global_ ` .tool-versions ` file. But where?
13
+
14
+ The ` asdf current ` command can tell us for a specific tool what the current
15
+ version it is set to and what file is giving that directive.
16
+
17
+ ``` bash
18
+ asdf current ruby
19
+ ruby 3.2.2 /Users/jbranchaud/code/.tool-versions
20
+ ```
21
+
22
+ As it turns out, I had a ` .tool-versions ` file in ` $HOME/code ` that was setting
23
+ that ` 3.2.x ` Ruby version.
24
+
25
+ I didn't want that directory controlling the Ruby version, so I removed ` ruby `
26
+ from that file. ` asdf ` was then able to traverse up to ` $HOME/.tool-versions `
27
+ for the global setting.
28
+
29
+ See ` asdf help ` for more details.
You can’t perform that action at this time.
0 commit comments