Windows 7 中的“ruby.exe 未被识别为内部或外部命令”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9852259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 04:55:40  来源:igfitidea点击:

"ruby.exe is not recognized as an internal or external command" in windows 7

rubywindows-7heroku

提问by joar

My os is windows 7 and I was about to connect my localhost MySQL database with the Heroku shared database, in one point of time, I got the error libmysql.dll file missing, so I searched and downloaded the dll file and saved it in ruby/bin directory. Again when I was about to connect, this time it shows the error ruby.exe is not recognized as an internal or external command this is how the error looks.

我的操作系统是windows 7,我正准备将我的localhost MySQL数据库与Heroku共享数据库连接起来,有一次,我发现错误libmysql.dll文件丢失,所以我搜索并下载了dll文件并将其保存在ruby中/bin 目录。再次当我要连接时,这次它显示错误 ruby​​.exe 未被识别为内部或外部命令,这是错误的外观。

Sending schema

发送模式

'"ruby.exe"' is not recognized as an internal or external command,TA:  --:--:--
operable program or batch file.
'"ruby.exe"' is not recognized as an internal or external command,TA:  00:00:07
operable program or batch file.
'"ruby.exe"' is not recognized as an internal or external command,TA:  00:00:04
operable program or batch file.
'"ruby.exe"' is not recognized as an internal or external command,TA:  00:00:02
operable program or batch file.
'"ruby.exe"' is not recognized as an internal or external command,TA:  00:00:01
operable program or batch file.

Schema: 100% |==========================================| Time: 00:00:06 '"ruby.exe"' is not recognized as an internal or external command, operable program or batch file.

架构:100% |==========================================| 时间:00:00:06 '"ruby.exe"' 不是内部或外部命令,也不是可运行的程序或批处理文件。

C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/lib/vendor/okj
son.rb:82:in `valparse': unexpected nil (OkJson::ParserError)
    from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/vendor/okjson.rb:64:in `textparse'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/vendor/okjson.rb:43:in `decode'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/operation.rb:419:in `push_indexes'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/operation.rb:408:in `block in run'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/operation.rb:203:in `call'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/operation.rb:203:in `catch_errors'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/operation.rb:405:in `run'
from C:/Program Files/Heroku/ruby/lib/ruby/gems/1.9.1/gems/taps-0.3.23/l
ib/taps/cli.rb:171:in `clientxfer'
from C:/Users/JOE ARPUTHAN/.heroku/client/lib/heroku/command/db.rb:194:i
n `taps_client'
from C:/Users/JOE ARPUTHAN/.heroku/client/lib/heroku/command/db.rb:35:in
 `push'
from C:/Users/JOE ARPUTHAN/.heroku/client/lib/heroku/command.rb:129:in `
run'
from C:/Program Files/Heroku/heroku:27:in `<main>'

回答by Boris Strandjev

You don't have the ruby.exe's path in your PATH variable.

ruby.exe的 PATH 变量中没有's 路径。

In windows 7 you can set it by Start menu-> right click My computer-> last option on the left (I think it was advanced settings) -> Environment variables -> in system variablessub menu find Pathdouble click it and add ; then the path to the bin folder of your ruby installation. This should fix it (you will need to restart all command prompts you have launched).

在Windows 7中,您可以通过Start menu->右键单击My computer->左侧的最后一个选项(我认为是advanced settings)->环境变量->在system variables子菜单中找到Path双击它并添加;然后是 ruby​​ 安装的 bin 文件夹的路径。这应该可以解决它(您需要重新启动您启动的所有命令提示符)。