How to solve the JSON installation error displayed in bundle install under Win

Source: Internet
Author: User

Environment: win7, ruby1.9.3p392 (despise me. Isn't it hard to find rails in win? I just don't bother to switch to Linux sometimes. Well, I only want to use win occasionally and hope it can run .)


Error: running in a rails ProjectBundle install(Or set up an octopress blog.Bundle installOther gems can be correctly installed.JSONHere is an inexplicable error =. =

As follows:

 

Installing JSON (1.7.7) GEM: Installer: extensionbuilderror: Error: failed to build gem native extension. c:/ruby193/bin/ruby.exe extconf. rbcreating makefilemake generating generator-i386-mingw32.defcompiling generator. cin file encoded ded from C:/ruby193/include/ruby-1.9.1/Ruby. h: 32: 0, from .. /fbuffer. h: 5, from generator. c: 1: C:/ruby193/include/ruby-1.9.1/Ruby. h: 109: 14: Error: size of Array 'Ruby _ check_sizeof_voidp 'is negative... // n rows = are omitted here. =


After checking various information, I finally found out that this is the reason why the C compiler is used in JSON,
Method 1:
See the solution to this problem on so.
Http://stackoverflow.com/questions/7780756/cannot-install-json-gem-in-rails-using-windows
According to this statement, only oneDevkitOn the line, download link: http://rubyinstaller.org/downloads/
Use please stamp https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

Method 2:
The reason why I don't describe it in detail is that this method is useless on my computer !!!
It's okay to switch back to Linux. JSON is not enough. So don't try rails again in win !!!!
But I found a new method last night, written in Ruby only.Json_pureJSON is replaced,
The specific method is as follows:
FindGemfile. Lock, Open it in a text editor and findJSON 1.7.7ChangeJson_pure 1.7.7
Run bundle install, and the your bunlde is complete. (Considering the instability of rubygems.org, we recommend using the http://ruby.taobao.org gem)

This sacrifices the demand for speed. After all, C runs faster =. = Is a solution ..

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.