gem install json でVirtualAlloc なんとやらのエラー
MinGWは入ってるし、DevKitも入ってるし、ということで、Windowsでgem install jsonしたら次のようなエラー。
$ gem install json Fetching: json-1.8.1.gem (100%) Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... D:\J-Drive\developments\environments\MinGW\msys\1.0\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0 ERROR: Error installing json: ERROR: Failed to build gem native extension. D:/J-drive/developments/environments/Ruby_1.9.3/bin/ruby.exe extconf.rb creating Makefile make 0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487 AllocationBase 0x0, BaseAddress 0x60EA0000, RegionSize 0x3F0000, State 0x10000 D:\J-Drive\developments\environments\MinGW\msys\1.0\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0 Gem files will remain installed in D:/J-Drive/developments/environments/Ruby_1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection. Results logged to D:/J-Drive/developments/environments/Ruby_1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
make.exeだけ実行してもエラー
$ make 0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487 AllocationBase 0x0, BaseAddress 0x60EA0000, RegionSize 0x3F0000, State 0x10000 D:\J-Drive\developments\environments\MinGW\msys\1.0\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
調べるとmsys-1.0.dllを差し替えればうまくいくとのこと。
http://stackoverflow.com/questions/12094801/json-gem-fails-to-build-on-windows
なおエラーになる理由はこちら--> http://d.hatena.ne.jp/kazy/20080310/p1
ちゃんとうまく動きました!
$ gem install json Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Successfully installed json-1.8.1 1 gem installed Installing ri documentation for json-1.8.1... Installing RDoc documentation for json-1.8.1...