【问题标题】:"ruby.exe is not recognized as an internal or external command" in windows 7Windows 7 中的“ruby.exe 未被识别为内部或外部命令”
【发布时间】:2012-04-08 18:48:49
【问题描述】:

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

发送模式

'"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.

架构: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>'

【问题讨论】:

  • Linux 答案:ruby 不在你的$PATH 中。我认为它是 Windows 中的 %PATH%
  • 如果鲍里斯的答案对您有用,请确保选择正确的答案,也可以为您的其他问题选择。
  • 我希望我能加倍! :D

标签: ruby windows-7 heroku


【解决方案1】:

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

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

【讨论】:

  • 这对我有用,感谢 Ton tazz 和 boris [ set path=%path%;"c:\Program Files\Heroku\ruby\bin"] 把它放在命令提示符中解决了它,再次感谢
  • @TheFrost 对我来说启动一个新终端就足够了,不需要重新启动整个系统
  • @BorisStrandjev - 这对我不起作用。你能帮我吗 - stackoverflow.com/questions/25212246/… 。提前致谢。
  • @Morfidon:您不需要重新启动整个机器 - 启动一个新终端就足够了(如果您从 cmd 终端与 Ruby 交互)。
  • 从势利的开源人群中听到一个不包括精英“扔掉你的 Windows 计算机并使用 Linux”的答案真是太棒了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-24
  • 2017-06-29
  • 1970-01-01
  • 1970-01-01
  • 2017-02-03
  • 2020-12-09
相关资源
最近更新 更多