Every time I run a Rails command such as rails -v
in ConEmu using the {bash::mintty} terminal, I get the following error: unknown mingwarch "msys" (RuntimeError)
.
However, ruby -v
works perfectly fine. In every other terminal, such as {cmd} and {PowerShell} (using ConEmu), or in the Git Bash app, I can run rails -v
without any problem. I don't know where the error comes from.
Here is the full trace:
$ rails -v
C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:36:in `initialize': unknown mingwarch "msys" (RuntimeError)
from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/singleton.rb:17:in `new'
from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/singleton.rb:17:in `msys2_installation'
from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/singleton.rb:27:in `enable_dll_search_paths'
from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/defaults/operating_system.rb:3:in `<top (required)>'
from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems.rb:1427:in `require'
from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems.rb:1427:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<internal:gem_prelude>'
I am using Windows 11, Rails 7.0.2.2, ConEmu 210912, Bash version 4.4.23(2) and Git for Windows 2.35.1.windows.2 (64-bit).
I found a solution. In Cmder's settings. Go to Startup → Tasks and click on Add/Refresh default tasks, and on the dialog box, click Refresh default tasks.
Then, in the Startup section (the parent one, neither the Tasks section, nor Environment), select the Specified named task to
{Bash::Git bash}
. And now everything works perfectly fine!This link helped me.