使用 {bash::mintty} 在 ConEmu 中运行 Rails 命令不起作用

发布于 2025-01-20 09:59:42 字数 1358 浏览 0 评论 0原文

每次我运行rails -v在conemu中使用 {bash :: mintty} 终端时,我会收到以下错误:未知的mingwarch” MSYS”(RuntimeError)

但是,ruby​​ -v效果很好。在其他每个终端中,例如 {cmd} {powerShell} (使用conemu),或在 git bash bash app中,我可以运行Rails -V没有任何问题。我不知道错误来自哪里。

这是完整的跟踪:

$ 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>'

我使用Windows 11,Rails 7.0.2.2,Conemu 210912,Bash版本4.4.23(2)和Windows 2.35.1.Windows.2(64-bit)的Git。

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).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奈何桥上唱咆哮 2025-01-27 09:59:42

我找到了一个解决方案。在CMDER的设置中。转到启动任务,然后单击 add/refresh默认任务,然后在对话框上,单击 refresh默认任务。

然后,在 startup e节(父级, task e节,也不是环境),选择指定的 name task task /em> to {bash :: git bash}。现在一切都很好!

link> link

I found a solution. In Cmder's settings. Go to StartupTasks 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文