Installing dm-types on Windows. (Win7 x64)

2020-03-03 08:21发布

I am trying to install dm-types for DataMapper on my machine with

gem install dm-types 

I've installed Ruby from RubyInstaller (1.9.3) and I also have the DevKit installed. (Aswell as some other gems like sinatra, haml, dm-core and bcrypt-ruby).
However, when I run "gem install dm-types", this happens.

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

My google-fu revealed that there are/were some bcrypt dependencies that won't build on windows but bcrypt installed flawlessly. I also have nmake.exe in my system path.

So how can I get dm-types to work on Windows 7 x64?

Also, I have absolutely no objection to wiping my machine clean of all ruby-related things and starting again.

3条回答
女痞
2楼-- · 2020-03-03 08:46

Or set your PATH in environment variables to C:\Progra~2\Ruby\Ruby193\bin instead of C:\Program Files\Ruby\Ruby193\bin

Progra~1 should be Program Files, Progra~2 should be Program Files (x86)

查看更多
beautiful°
3楼-- · 2020-03-03 09:05

What Mayro said was right on the money, the thing I had to look out for was that In addition to the user PATH the link to the DevKit was also in the System Variables PATH which had the link that was causing my problem.

查看更多
Fickle 薄情
4楼-- · 2020-03-03 09:09

It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:

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

and then try installing. You can delete the symlink after installing.

C:\ruby\bin\gem install dm-types
查看更多
登录 后发表回答