Ruby Install / Init not find dk.rb

时间:2014-05-29 20:19:26

标签: ruby install init

我试图在Win7上下载/安装Ruby(我是Ruby的新手)。

我去了这个网址: http://rubyinstaller.org/downloads/和下载的版本" Ruby 1.9.3-p545"我安装到以下文件夹/目录中:C:\ RubyDevKit \(文件夹名称中没有空格)。

当我尝试执行init步骤时,我收到以下错误:

C:\RubyDevKit>ruby dk.rb init
ruby: No such file or directory -- dk.rb (LoadError)

我在命令行上运行了这个:

C:\RubyDevKit>ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]

所以我安装了ruby并且我在正确的目录中(根据此SO链接:LoadError when installing ruby devkit

我也试过并得到了同样的错误:

C:\RubyDevKit>chcp 1252
Active code page: 1252

我确实安装了Aptana v3,构建了3.4.2.201308081805(但没有其他版本的Ruby)。我也无法通过Windows资源管理器/ cmd行在任何地方找到实际文件dk.rb。

C:\RubyDevKit>dir
Volume in drive C is Local Disk
Volume Serial Number is 0CBF-3D16

Directory of C:\RubyDevKit

05/29/2014  03:04 PM    <DIR>          .
05/29/2014  03:04 PM    <DIR>          ..
05/29/2014  03:04 PM    <DIR>          bin
05/29/2014  03:04 PM    <DIR>          doc
05/29/2014  03:04 PM    <DIR>          include
05/29/2014  03:04 PM    <DIR>          lib
05/29/2014  03:04 PM    <DIR>          share
05/29/2014  03:04 PM           167,349 unins000.dat
05/29/2014  03:04 PM         1,193,995 unins000.exe
           2 File(s)      1,361,344 bytes
           7 Dir(s)  1,287,681,196,032 bytes free

bin目录:

C:\RubyDevKit>cd bin

C:\RubyDevKit\bin>dir
Volume in drive C is Local Disk
Volume Serial Number is 0CBF-3D16

Directory of C:\RubyDevKit\bin

05/29/2014  03:04 PM    <DIR>          .
05/29/2014  03:04 PM    <DIR>          ..
02/24/2014  09:20 PM             4,397 erb
02/24/2014  09:20 PM               177 erb.bat
02/24/2014  09:20 PM               921 gem
02/24/2014  09:20 PM               177 gem.bat
02/24/2014  09:20 PM               318 irb
02/24/2014  09:20 PM               177 irb.bat
02/24/2014  09:20 PM         1,486,336 libeay32.dll
02/24/2014  09:20 PM           127,316 libffi-6.dll
02/24/2014  09:20 PM           140,586 libgdbm-3.dll
02/24/2014  09:20 PM           103,726 libgdbm_compat-3.dll
02/24/2014  09:20 PM         1,262,898 libiconv-2.dll
02/24/2014  09:20 PM           441,874 libyaml-0-2.dll
02/24/2014  09:17 PM         2,289,664 msvcrt-ruby191.dll
02/24/2014  09:20 PM           238,505 pdcurses.dll
02/24/2014  09:20 PM             1,231 rake
02/24/2014  09:20 PM               177 rake.bat
02/24/2014  09:20 PM               788 rdoc
02/24/2014  09:20 PM               177 rdoc.bat
02/24/2014  09:20 PM               188 ri
02/24/2014  09:20 PM               177 ri.bat
02/24/2014  09:17 PM            70,239 ruby.exe
02/24/2014  09:17 PM            70,239 rubyw.exe
12/30/2013  01:11 PM               312 setrbvars.bat
02/24/2014  09:20 PM           341,504 ssleay32.dll
02/24/2014  09:20 PM               298 testrb
02/24/2014  09:20 PM               177 testrb.bat
02/24/2014  09:20 PM            83,968 zlib1.dll
          27 File(s)      6,666,547 bytes
           2 Dir(s)  1,287,679,569,920 bytes free

我不知道如何让Ruby启动并运行,特别是通过&#34; init&#34;步骤

修改: 在Aptana IDE中 - &gt;终端I输入:

$ gem install ruby-debug-ide --platform=ruby

然后回来了:

Fetching: ruby-debug-ide-0.4.22.gem (100%)
ERROR:  Error installing ruby-debug-ide:
    The 'ruby-debug-ide' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

还要添加(从cmd行:

C:\RubyDevKit\bin>gem -v
1.8.28

2 个答案:

答案 0 :(得分:0)

您只需要DEVKIT来构建本机C扩展。

在您的情况下,听起来您没有单独下载DEVKIT。 其次确保DEVKIT和Ruby在架构上匹配,以及运行的系统(x86 / 64)。

考虑以下教程: http://www.waydotnet.com/2010/02/12/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/

答案 1 :(得分:0)

如果其他人遇到此问题,真正的答案是最新版本的DevKit没有名为dk.rb的文件。只有与Ruby 1.9.3-p551一起使用的旧版DevKit 4.5(DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe)才使用dr.rb配置脚本。

TL; DR:如果按照提到dk.rb的教程,最简单的方法就是使用Ruby 1.9和DevKit 4.5