Ruby bson_ext gem is not installing in windows - ruby

I installed mongo gem. But during run time it says it requires bson_ext gem needs to be installed. So i am trying to install bson_ext gem in windows 7 professional and i couldn't. i am getting the below errors while installing and so i couldn't connect Ruby to my mongo server. Caould anyone help me to resolve this. i searched all areas and i found some saying doing "gem update --system" solves the problem. But even i get error for gem update option. I am new to Ruby and Cucumber.
C:\Manimaran\Ruby>gem source
*** CURRENT SOURCES ***
http://rubygems.org/
C:\Manimaran\Ruby>gem install bson_ext
WARNING: Error fetching data: Errno::ETIMEDOUT: A connection attempt failed bec
ause the connected party did not properly respond after a period of time, or est
ablished connection failed because connected host has failed to respond. - conne
ct(2) (http://rubygems.org/specs.4.8.gz)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing bson_ext:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for asprintf()... no
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make
generating cbson-i386-mingw32.def
compiling bson_buffer.c
compiling cbson.c
cbson.c:25:23: fatal error: arpa/inet.h: No such file or directory
compilation terminated.
make: *** [cbson.o] Error 1
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/bson_ext-
1.11.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/bson_ext-1.11.1/ext/cbson/
gem_make.out

the #include in the file cbson.c should be changed into #include. Then you need to build the your own gem and install it locally
Following thread describes it perfectly:
windows: rails: error installing bson_ext

Related

Unable to find dnssd headers error while trying to install a ruby gem

Getting this error
ERROR: Error installing dnssd:
ERROR: Failed to build gem native extension.
/Users/me/.rvm/rubies/ruby-1.9.3-p550/bin/ruby -r ./siteconf20141108-39945-13la3bu.rb extconf.rb
checking for dns_sd.h... no
unable to find dnssd header
*** extconf.rb failed ***
Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.9.3-p550#kevy/gems/dnssd-2.0 for inspection.
Results logged to /Users/me/.rvm/gems/ruby-1.9.3-p550#kevy/extensions/x86_64-darwin-14/1.9.1/dnssd-2.0/gem_make.out
An error occurred while installing dnssd (2.0), and Bundler cannot continue.
Make sure that `gem install dnssd -v '2.0'` succeeds before bundling.
I'm running yosemite osx so the header file is there by default. I found it at /usr/include/dns_sd.h.
Short of reinstalling operating system is there any way to fix?
Thanks

Error updating Ruby gem sequel_pg

when I try to install the Ruby gem sequel_pg I get the following error meassage:
~$ sudo gem update
Updating installed gems
Updating sequel_pg
Building native extensions. This could take a while...
ERROR: Error installing sequel_pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for PQsetSingleRowMode()... no
creating Makefile
make
compiling sequel_pg.c
sequel_pg.c: In function ‘spg_timestamp_error’:
sequel_pg.c:279:3: error: format not a string literal and no format arguments [- Werror=format-security]
cc1: some warnings being treated as errors
make: *** [sequel_pg.o] Error 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5/ext/sequel_pg/gem_make.out
Nothing to update
I am running Lubuntu 13.04. The depencies: pg and sequel are installed. Packages files postgresql and postgresql-server-dev-9.1 is also installed
Does anyone have a clue?
This bug was fixed in master of the gem with this patch. You should wait for new release or install head version of the gem.

Can't install json gem on Windows7

I'm running Windows7 and I've having great difficulty installing the json gem. The error I'm getting hasn't been addressed anywhere. I have installed DevKit through the RailsInstaller and when I run gem install json I get the following error:
C:\Users\Gavin>gem install json
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
make
Makefile:161: warning: overriding commands for target `install-so'
Makefile:160: warning: ignoring old commands for target `install-so'
Makefile:162: *** missing separator. Stop.
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/bin;/gems/json-1.7.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/bin;/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
Anyone have any ideas what may be going on here?
i suppose your devkit-folder is in the path ? Otherwise try it with "gem install json_pure" instead. See this article that explains why http://ruby.about.com/od/tasks/a/The-Json-Gem.htm

json doesn't install

I am having a problem getting my ruby system up and running. Specifically, I get the following error when trying
gem install json
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
c:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
generating parser-i386-mingw32.def
compiling parser.c
gcc.exe: CreateProcess: No such file or directory
make: *** [parser.o] Error 1
Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/pa
I know that my gcc works. I don't get the same error when installing
`gem install json_pure
However, when I try a
bundle install
I get the error. I am extremely new to ruby and rails, so any help would be appreciated.
install devkit with --force option

Problem install do_sqlite3 for DataMapper

sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
I have sqlite3-ruby installed as well as the header files, but for some reason it fails when checking for sqlite3_open()
I am having the same issue:
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions. This could take a while...
ERROR: Error installing do_sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_sqlite3-0.10.1.1/ext/do_sqlite3/gem_make.out
I am running Snow Leopard. I'm not sure about previous installations of sqlite3 but I did try this:
port search sqlite
And it returned the following (among others):
...
sqlite3 #3.6.17 (databases)
an embedded SQL database engine
To be honest I'm not sure what all this means. What would anyone suggest for getting do_sqlite3 installed for use in Rails 3 with DataMapper? (Also, running it without the 'env ARCHFLAGS="-arch x86_64"' gives the same errors.)
Ok, first question is why are you passing the ARCHFLAGS? That should not be necessary, if it also doesn't work without passing them, what is the output you get then?
Next question is what version of sqlite3 is it picking up? Do you have sqlite3 installed through Macports for example? Did you upgrade to Snow Leopard recently and still have an sqlite3 install from before upgrading?

Resources