According to this post, <arpa/inet.h> not a window library, so winsock2.h should be used instead.
To change this link, I did the following **:
- Go to the installation folder (c: /Ruby193/lib/ruby/gems/1.9.1/gems/bson_ext-1.11.1)
- Fold the level to the cbson folder and find cbson.c
- Open cbson.c in your favorite text editor and find the line that reads
#include "<arpa/inet.h>" - Change this line to
#include winsock2.h - Open a command prompt, go to the installation folder and run
gem build bson_ext.gemspec - Move the newly created .gem file to a safe location (for example,% userprofile% \ Desktop).
- Go up to the gem folder and delete the entire bson_ext folder
- Return to the command prompt window, change the directory to where you placed the newly created .gem file (cd% userprofile% \ Desktop, if you follow these steps for sure)
- Run
gem install bson_ext-1.11.1.gem --local , and the pearl should now install successfully.
** Huge caveat: I'm just looking at mongodb for a rail guide, and I don't have any functional code to check this out. Although this fixes the installation error, I cannot determine if this fix is โโcomplete. This reference library is new to release 1.11.1. If you install version 1.10.2, this problem will not occur ( gem install bson_ext -v 1.10.2 ). I will leave it to you to decide which solution makes more sense to you.
Edit: based on a change in the bson-ruby project on github, the best fix would be a change that involves reading this:
#ifdef _WIN32 #include <winsock2.h> #else #include <arpa/inet.h> #endif
Brick source share