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

Is it possible to run without powershell after installation? #22

Open
dig12345 opened this issue Dec 31, 2023 · 6 comments
Open

Is it possible to run without powershell after installation? #22

dig12345 opened this issue Dec 31, 2023 · 6 comments

Comments

@dig12345
Copy link

Is it possible to run this ruby without powershell after installation. I was able to install under powershell but would like to be able to launch ruby from cmd.exe terminals etc. If I try to run ruby.exe from cmd terminal I get:
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
Thanks

@ccmywish
Copy link
Collaborator

ccmywish commented Jan 2, 2024

Hi @dig12345

Thanks for reporting. In fact, we can run ruby directly in CMD.exe:

image

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

Sorry I don't know what does the log mean. But I think you should know that, after installing the rbenv, there's an automatic process of installation of the latest ruby in PowerShell. After that, then you can invoke ruby both in PowerShell and CMD.exe.

If you already finish the process above, and still get the error message, please tell me what your Windows's version is. I only test it on Windows 10 and 11, I don't know if Windows 7 will work.

@dig12345
Copy link
Author

dig12345 commented Jan 2, 2024

I discovered that the error was coming from an old ruby I had previously installed. I've removed that and it looks better. Now my question is did you manually add it to the path? I can only run it by specifying the whole path: 'C:\ruby\3.2.2-1\bin\ruby.exe' under cmd. I can add that folder to the path but I will have to change it for every version?

@ccmywish
Copy link
Collaborator

ccmywish commented Jan 2, 2024

You don't need to add every version to PATH.

In my CMD.exe, you can see:
image

Just be sure to include these two paths at the front to your PATH as above.

  1. C:\your_rbenv_root\rbenv\bin
  2. C:\your_rbenv_root\shims

In fact, all my CMD.exe are run from a PowerShell session, and since my PowerShell has already defined the rbenv's related path (See the README, it's auto added by & "$env:RBENV_ROOT\rbenv\bin\rbenv.ps1" init ), so my CMD.exe get them too.

@dig12345
Copy link
Author

dig12345 commented Jan 2, 2024

Ok I solved this by adding the following 2 things to the path:
c:\ruby\rbenv\bin
c:\ruby\shims
And adding a system environment variable
named: RBENV_ROOT
set to: c:\ruby
now when I open CMD it works! Thanks

@dig12345
Copy link
Author

dig12345 commented Jan 4, 2024

I wonder if it would be possible to have the installer add these vars automatically?

@ccmywish
Copy link
Collaborator

ccmywish commented Jan 4, 2024

Sounds reasonable, I'll add it with some other updates when I have time.

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

2 participants