0

安装 gem 后,我无法执行命令“rhc setup”。我使用了来自 ruby​​installersr.org 的 Windows 安装程序。请在执行 rhc setup 后查看以下输出:

>     C:\Users\Admin>rhc setup
>     /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rh
>      (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.8.0, minitest-2.5.1,
>     ake-10.0.4, rdoc-3.12.2] (Gem::LoadError)
>             from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
>             from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
>             from C:/Ruby200-x64/bin/rhc:22:in `<main>'

Gem 安装已成功执行。请看下面的输出:

C:\Users\Admin>ruby -e 'puts "hello world"'
hello world

C:\Users\Admin>ruby -v
ruby 1.9.3p545 (2014-02-24) [x86_64-cygwin]

C:\Users\Admin>gem install rhc
Fetching: net-ssh-2.9.1.gem (100%)
Successfully installed net-ssh-2.9.1
Fetching: net-scp-1.2.1.gem (100%)
Successfully installed net-scp-1.2.1
Fetching: net-ssh-gateway-1.2.0.gem (100%)
Successfully installed net-ssh-gateway-1.2.0
Fetching: net-ssh-multi-1.2.0.gem (100%)
Successfully installed net-ssh-multi-1.2.0
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Successfully installed archive-tar-minitar-0.5.2
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
Fetching: commander-4.2.0.gem (100%)
Successfully installed commander-4.2.0
Fetching: httpclient-2.4.0.gem (100%)
Successfully installed httpclient-2.4.0
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: rhc-1.28.5.gem (100%)
===========================================================================

If this is your first time installing the RHC tools, please run 'rhc setup'

===========================================================================
Successfully installed rhc-1.28.5
Parsing documentation for net-ssh-2.9.1
Installing ri documentation for net-ssh-2.9.1
Parsing documentation for net-scp-1.2.1
Installing ri documentation for net-scp-1.2.1
Parsing documentation for net-ssh-gateway-1.2.0
Installing ri documentation for net-ssh-gateway-1.2.0
Parsing documentation for net-ssh-multi-1.2.0
Installing ri documentation for net-ssh-multi-1.2.0
Parsing documentation for archive-tar-minitar-0.5.2
Installing ri documentation for archive-tar-minitar-0.5.2
Parsing documentation for highline-1.6.21
Installing ri documentation for highline-1.6.21
Parsing documentation for commander-4.2.0
Installing ri documentation for commander-4.2.0
Parsing documentation for httpclient-2.4.0
Installing ri documentation for httpclient-2.4.0
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for rhc-1.28.5
Installing ri documentation for rhc-1.28.5
10 gems installed

C:\Users\Admin>gem update rhc
Updating installed gems
Nothing to update

C:\Users\Admin>rhc setup
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rh
 (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.8.0, minitest-2.5.1,
ake-10.0.4, rdoc-3.12.2] (Gem::LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
        from C:/Ruby200-x64/bin/rhc:22:in `<main>'

需要一些有关如何修复此错误的建议。

谢谢

4

2 回答 2

2

你以前安装过 ruby​​ 并且可能忘记了它吗?看起来它正试图在 C:/Ruby200-x64/bin 文件夹中找到可能没有它的 gem。尝试检查您的程序并卸载所有版本的 Ruby 并再次安装 1.9.3 版 - 从我收集的内容来看,这在 Windows 上效果最好。

于 2014-08-12T07:53:19.113 回答
0

尝试从我的 cygwin shell 调用 rhc 设置时,我遇到了类似的错误。查看 ruby​​ 安装,我发现了 rhc shell 脚本和 rhc.bat Windows 脚本。我能够从我的 Cygwin shell 运行 rhc.bat 而不会遇到错误。

于 2015-07-30T15:06:17.743 回答