# Error installing json with igem

**URL:** <https://www.ruby-forum.com/t/error-installing-json-with-igem/192131>\
**Category:** IronRuby\
**Created:** [July 24, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131 "2010-07-24T14:34:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [July 24, 2010, 2:34pm UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131/1 "2010-07-24T14:34:01Z")

</div>

When attempting:

igem install json

I get an error stating “ERROR: Failed to build gem native extension.”

I have installed some other gems ok and using the plain old Ruby “gem  
install json” works.

Is there something I can do to workaround the problem?

Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [July 24, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131/2 "2010-07-24T14:58:46Z")

</div>

When you get that error it means that the gem depends on C extensions.  
These  
are not supported by IronRuby.

Shay.

---

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [July 25, 2010, 10:25am UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131/3 "2010-07-25T10:25:53Z")

</div>

On Sat, Jul 24, 2010 at 14:34, Aaron C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I get an error stating “ERROR: Failed to build gem native extension.”

As Shay has already pointed out, you get this error when the gem that  
you are trying to install depends on some native code.

> Is there something I can do to workaround the problem?

You can install json\_pure which is the pure-Ruby variant of the C  
extension and works pretty well with IronRuby (it’s just slower…  
well, way slower when parsing big json strings).

Alternatively you can try my port [1] to IronRuby of the json/ext  
library. The port is pretty much complete and it is compatible with  
json 1.1. It passes the whole test suite except for one assertion  
defined in test\_json\_unicode.rb [2]. Right now I’m in the middle of a  
complete revamp of the source code after a few months of hiatus  
(fixing sloppy code here and there and getting rid of awful nasty  
hacks needed to work around a few bugs in IronRuby pre-1.0), then I  
will bump the compatibility to json 1.4.

[1] [GitHub - nrk/ironruby-json: A port of Florian Frank's json library to IronRuby · GitHub](http://github.com/nrk/ironruby-json)  
[2] [ironruby-json test suite results · GitHub](http://gist.github.com/303469)

–  
Daniele A.

> **[clorophilla.net](https://clorophilla.net/)**

[http://twitter.com/JoL1hAHN](http://twitter.com/JoL1hAHN)

---

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [July 25, 2010, 2:08pm UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131/4 "2010-07-25T14:08:47Z")

</div>

Mark Rendle wrote:

> You can use json\_pure, which has no native code but provides all the  
> same classes and methods.

Thanks a lot for that tip, works perfectly.

---

<div class="post-metadata">

**Author:** ![acampos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@acampos](https://www.ruby-forum.com/u/acampos)\
**Post date:** [July 24, 2010, 6:14pm UTC](https://www.ruby-forum.com/t/error-installing-json-with-igem/192131/5 "2010-07-24T18:14:16Z")

</div>

You can use json\_pure, which has no native code but provides all the  
same classes and methods.

Mark

Sent from my iPhone
