Skip to content
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

ridk use tool doesn't work. #314

Closed
Vucius opened this issue Nov 3, 2022 · 3 comments
Closed

ridk use tool doesn't work. #314

Vucius opened this issue Nov 3, 2022 · 3 comments

Comments

@Vucius
Copy link

Vucius commented Nov 3, 2022

ridk use tool doesn't work.

I installed ruby2.7.6 with DEVKIT via rubyinstaller-devkit-2.7.6-1-x64.exe.
And then installed ruby3.0.2 via rubyinstaller-3.0.2-1-x64.exe.
But, I found I couldn't switch back to ruby2.7.6 via ridk ues
cmd information:

$ ridk version
---
ruby:
  path: X:/Ruby/Ruby30-x64
  version: 3.0.2
  platform: x64-mingw32
  cc: gcc.exe (Rev5, Built by MSYS2 project) 10.3.0
ruby_installer:
  package_version: 3.0.2-1
  git_commit: 80c9ca9
msys2:
  path: X:\Ruby\msys64
cc: gcc (Rev5, Built by MSYS2 project) 12.2.0
sh: GNU bash,版本 5.1.16(2)-release (x86_64-pc-msys)
os: Microsoft Windows [�汾 10.0.19044.2006]

$ ridk disable

$ ridk use
1 - X:/Ruby/Ruby27-x64  ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x64-mingw32]
2 - X:/Ruby/Ruby30-x64  ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
Select ruby version to enable: 1
Disable X:/Ruby/Ruby27-x64
Disable X:/Ruby/Ruby30-x64
Enable X:/Ruby/Ruby27-x64

$ idk enable

$ ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x64-mingw32]

And then, I closed cmd.exe, and open a new one
cmd information:

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]

I did those thing on another computer, it performed same.

@larskanis
Copy link
Member

ridk use is always only for the current shell. It's meant to quickly switch between different ruby versions or to run different projects with a dedicated ruby version.

The permanent switch between ruby versions is through the PATH environment variable in the Windows system settings. Just change the path from X:/Ruby/Ruby30-x64 to X:/Ruby/Ruby27-x64 there or drop multiple entries if there are any.

I still have some parameter in mind, that makes the switch permanent (like ridk use --default or so), but so far this isn't implemented.

@Vucius
Copy link
Author

Vucius commented Nov 3, 2022

ridk use is always only for the current shell. It's meant to quickly switch between different ruby versions or to run different projects with a dedicated ruby version.

The permanent switch between ruby versions is through the PATH environment variable in the Windows system settings. Just change the path from X:/Ruby/Ruby30-x64 to X:/Ruby/Ruby27-x64 there or drop multiple entries if there are any.

I still have some parameter in mind, that makes the switch permanent (like ridk use --default or so), but so far this isn't implemented.

Now i know how to swith different ruby.thank u

@Vucius Vucius closed this as completed Nov 3, 2022
@mohits
Copy link
Collaborator

mohits commented Nov 3, 2022

I find using pik a simple way to run using different Ruby versions on Windows, and wrote about it here: https://notepad.onghu.com/2021/ruby3-windows-pik-multiple-installations/

larskanis added a commit that referenced this issue Nov 27, 2022
.. to store the change permanently in the user or system environment variables.

Fixes #314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants