【问题标题】:Installing dm-types on Windows. (Win7 x64)在 Windows 上安装 dm-types。 (Win7 x64)
【发布时间】:2012-02-11 20:51:59
【问题描述】:

我正在尝试使用

在我的机器上为 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 上工作?

另外,我完全不反对将我的机器上所有与 ruby​​ 相关的东西擦干净,然后重新开始。

【问题讨论】:

    标签: ruby windows rubygems datamapper


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 谢谢!它起作用了:)我看到它打破了关于空格的文件路径,但很难相信空格实际上搞砸了安装(因此认为我做错了其他事情)。对于任何有同样问题的人,C:\ruby\ruby.exe 将不起作用,因为它实际上位于 bin 目录中。 'C:\ruby\bin\gem install dm-types' 是我使用的命令。
    • 感谢列夫的跟进!节省了我至少一个小时的谷歌搜索时间。
    【解决方案2】:

    Mayro 说的是对的,我需要注意的是,除了用户 PATH 之外,DevKit 的链接也在系统变量 PATH 中,其中包含导致我的问题的链接。

    【讨论】:

      【解决方案3】:

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

      Progra~1 应该是 Program Files,Progra~2 应该是 Program Files (x86)

      【讨论】:

        猜你喜欢
        • 2013-02-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-03
        • 1970-01-01
        • 2013-07-10
        • 1970-01-01
        • 2013-01-03
        相关资源
        最近更新 更多