简体   繁体   English

安装gem时出错:无法为cygwin的堆保留空间,Win32错误487

[英]Error installing gem: Couldn't reserve space for cygwin's heap, Win32 error 487

I'm trying to install win32-api gem on my machine and I'm facing some issues when building native extensions: 我正在尝试在我的机器上安装win32-api gem,在构建原生扩展时我遇到了一些问题:

$ gem install win32-api --no-ri --rdoc
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
C:\Programs\dev_kit\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
ERROR:  Error installing win32-api:
        ERROR: Failed to build gem native extension.

        c:/Programs/ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile

make
      0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x60E90000, RegionSize 0x170000, State 0x10000
C:\Programs\dev_kit\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0

This problem happens when installing any gem that tries to compile a native extension, like json or win32-api, for instance. 安装任何尝试编译本机扩展的gem时会发生此问题,例如json或win32-api。

I already tried to change the size of virtual memory of this machine, but it didn't work. 我已经尝试改变这台机器的虚拟内存大小,但它没有用。

My configuration: 我的配置:

  • Ruby version: 1.8.7p371 Ruby版本:1.8.7p371
  • Gem version: 1.8.24 宝石版:1.8.24
  • Bash 3.1.0 Bash 3.1.0
  • DevKit 4.5.2 DevKit 4.5.2
  • Windows 7 x64 Windows 7 x64

I was facing the exact same issue and after making a lot of searches and many different tries, this is what fixed it for me: 我遇到了完全相同的问题,在进行了大量的搜索和许多不同的尝试后,这就是为我解决的问题:

  1. Download rebase from http://www.tishler.net/jason/software/rebase/ (download the latest *.exe version) and run it. http://www.tishler.net/jason/software/rebase/下载rebase (下载最新的* .exe版本)并运行它。

  2. Fire up a Prompt ("Run as administrator") and go to your dev-kit folder (for instance, mine was C:\\Programs\\dev_kit ) 启动提示符(“以管理员身份运行”)并转到dev-kit文件夹(例如,我的是C:\\Programs\\dev_kit

  3. While in the dev-kit folder, run devkitvars.bat to add devkit to the path. 在dev-kit文件夹中,运行devkitvars.bat以将devkitvars.bat添加到路径中。

  4. Now do a cd bin (it got me to C:\\Programs\\dev_kit\\bin ) and from there run: 现在做一个cd bin (它让我到C:\\Programs\\dev_kit\\bin )并从那里运行:

     rebase -b 0x30000000 msys-1.0.dll 

Try to install the gems again. 尝试再次安装宝石。 Instead of seeing an error message, now you should see Building native extensions. This could take a while... 现在您应该看到Building native extensions. This could take a while... ,而不是看到错误消息Building native extensions. This could take a while... Building native extensions. This could take a while... and it will hang for a while there. Building native extensions. This could take a while...它会在那里停留一段时间。

Your gem should be successfully installed after a couple of minutes/seconds. 几分钟/秒后,您的宝石应该成功安装。 No more headaches :) 不再头疼:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM