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

Lev*_*ets 5 ruby windows rubygems datamapper

我正在尝试在我的机器上安装DataMapper的dm-types

gem install dm-types 
Run Code Online (Sandbox Code Playgroud)

我从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
Run Code Online (Sandbox Code Playgroud)

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

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

此外,我绝对不反对擦拭我的机器清洁所有与红宝石有关的东西并重新开始.

小智 13

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

mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"
Run Code Online (Sandbox Code Playgroud)

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

C:\ruby\bin\gem install dm-types
Run Code Online (Sandbox Code Playgroud)

  • 谢谢!它工作:)我看到它打破了关于空格的文件路径,但很难相信空白实际上搞砸了安装(并因此认为我做了别的错误).对于任何有相同问题的人,C:\ ruby​​\ruby​​.exe将无法正常工作,因为它实际上位于bin目录中.'C:\ ruby​​\bin\gem install dm-types'是我使用的命令. (5认同)