在Windows上安装dm-types。 (Win7 x64)

时间:2012-01-17 00:09:00

标签: ruby windows rubygems datamapper

我正在尝试使用

在我的机器上为DataMapper安装dm-types
gem install dm-types 

我从RubyInstaller(1.9.3)安装了Ruby,我也安装了DevKit。 (以及其他一些宝石,如sinatra,haml,dm-core和bcrypt-ruby)。
但是,当我运行“gem install dm-types”时,会发生这种情况。

C:\Users\Lev>gem install dm-types
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing dm-types:
        ERROR: Failed to build gem native extension.

        "C:/Program Files (x86)/Ruby/Ruby193/bin/ruby.exe" extconf.rb
creating Makefile

make
Makefile:172: warning: overriding commands for target `C:/Program'
Makefile:163: warning: ignoring old commands for target `C:/Program'
Makefile:172: warning: overriding commands for target `Files'
Makefile:163: warning: ignoring old commands for target `Files'
Makefile:215: *** multiple target patterns.  Stop.


Gem files will remain installed in C:/Program Files (x86)/Ruby/Ruby193/lib/ruby/
gems/1.9.1/gems/json-1.6.5 for inspection.
Results logged to C:/Program Files (x86)/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/j
son-1.6.5/ext/json/ext/parser/gem_make.out

我的google-fu透露,有些bcrypt依赖项不能在windows上构建,但是bcrypt安装得很完美。我的系统路径中也有nmake.exe。

那么我怎样才能让dm-types在Windows 7 x64上运行?

另外,我绝对不反对擦干我所有与红宝石有关的东西并重新开始。

3 个答案:

答案 0 :(得分:13)

看起来ruby路径中的空格正在搞乱makefile。也许尝试暂时在Windows上创建符号链接,例如:

mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"

然后尝试安装。您可以在安装后删除符号链接。

C:\ruby\bin\gem install dm-types

答案 1 :(得分:2)

Mayro说钱是正确的,我必须注意的是除了用户PATH之外,DevKit的链接也在系统变量PATH中,该链接导致了我的问题。

答案 2 :(得分:1)

或者将环境变量中的PATH设置为C:\ Progra~2 \ Ruby \ Ruby193 \ bin而不是C:\ Program Files \ Ruby \ Ruby193 \ bin

Progra~1应为Program Files,Progra~2应为Program Files(x86)