geohash
geohash copied to clipboard
Ruby 1.9: Failed to build gem native extension.
Hi, trying to install gem on ruby 1.9, I got the following error:
Building native extensions. This could take a while... ERROR: Error installing davetroy-geohash: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb creating Makefile
make gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -fPIC -O2 -g -Wall -Wno-parentheses -o geohash_native.o -c geohash_native.c geohash_native.c: In function ‘encode’: geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’ geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’ geohash_native.c: In function ‘decode_bbox’: geohash_native.c:135: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c: In function ‘decode’: geohash_native.c:158: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c: In function ‘calculate_adjacent’: geohash_native.c:196: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c:199: error: ‘struct RString’ has no member named ‘ptr’ make: *** [geohash_native.o] Błąd 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/davetroy-geohash-1.1.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/davetroy-geohash-1.1.0/ext/gem_make.out
Hello Stanley,
did you manage to compile geohash ? I meet the same issue today with 1.9.2.
No. I did not. Sorry. There is another geohash lib though: http://github.com/masuidrive/pr_geohash
I created a fork to fix 1.9 support: http://github.com/sticksnleaves/geohash.
Update: I have removed my fork since it was merged into version 1.1.1 of geohash. The version in RubyGems (1.0.1) is not 1.9 compatible as of 05/15/2011. Use the version in GitHub.
Hello, I'm trying to install geohash with 1.9.2 and am getting the following error. Any advice on getting it to work with 1.9.2?
brashice:sizonet young$ gem install davetroy-geohash Building native extensions. This could take a while... ERROR: Error installing davetroy-geohash: ERROR: Failed to build gem native extension.
/Users/young/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb creating Makefile
make gcc -I. -I/Users/young/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-darwin10.4.0 -I/Users/young/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/Users/young/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o geohash_native.o -c geohash_native.c geohash_native.c: In function ‘decode_geohash_bbox’: geohash_native.c:44: warning: implicit conversion shortens 64-bit value into a 32-bit value geohash_native.c: In function ‘encode’: geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’ geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’ geohash_native.c: In function ‘decode_bbox’: geohash_native.c:135: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c: In function ‘decode’: geohash_native.c:158: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c: In function ‘get_neighbor’: geohash_native.c:172: warning: initialization discards qualifiers from pointer target type geohash_native.c:173: warning: initialization discards qualifiers from pointer target type geohash_native.c:174: warning: initialization discards qualifiers from pointer target type geohash_native.c:175: warning: initialization discards qualifiers from pointer target type geohash_native.c:177: warning: initialization discards qualifiers from pointer target type geohash_native.c:177: warning: initialization discards qualifiers from pointer target type geohash_native.c:177: warning: initialization discards qualifiers from pointer target type geohash_native.c:177: warning: initialization discards qualifiers from pointer target type geohash_native.c: In function ‘calculate_adjacent’: geohash_native.c:196: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c:199: error: ‘struct RString’ has no member named ‘ptr’ geohash_native.c:199: warning: implicit conversion shortens 64-bit value into a 32-bit value make: *** [geohash_native.o] Error 1
Gem files will remain installed in /Users/young/.rvm/gems/ruby-1.9.2-p0/gems/davetroy-geohash-1.1.0 for inspection. Results logged to /Users/young/.rvm/gems/ruby-1.9.2-p0/gems/davetroy-geohash-1.1.0/ext/gem_make.out brashice:sizonet young$ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] brashice:sizonet young$
Geohash is not 1.9 compatible.
Use my fork: http://github.com/sticksnleaves/geohash
Strange. there is a commit that should provide 1.9.2 compatibility. But when I'n installing a gem it does not look like being merged. any idea why?
What version? Version 1.1.1 has 1.9 compatibility. Version 1.0.1 is currently in the rubygems repository. You will need to use what's on GitHub.
thanks, got it working
Aha! Had the same issue with rubygems version, github repo version working fine on ruby 1.9.1p376 here =)
Thanks @sticksnleaves
@sticksnleaves I can't get to your repo. Does anyone still have a copy of this somewhere?
@comp615 I believe that my changes were merged into master. The version of geohash (1.0.1) on RubyGems is not compatible with 1.9. Version 1.1.1 should be 1.9 compatible but is only available through GitHub.
It would be awesome if a new gem-version was released with the latest fixes. Any chance of that? The 03d655d5bf92 has been working great for a while for me.
@sticksnleaves I'm not seeing 1.1.1 available on the GitHub listing either. What was your fork merged into? This repo?
Yes, my fork was merged into davetroy/geohash master branch. As far as I know it was never packaged into a gem.
Any chance you could push this up to rubygems?
Ruby 1.9 is pretty standard these days - it's unfortunate that the current version of this gem does not work with it.
While waiting for a new version of this gem to be pushed, you can use sideshowcoder's version:
gem 'geohash', git: 'git://github.com/sideshowcoder/geohash.git'
It works with Ruby 1.9.3.
hth
+1
I've been working on an up-to-date fork at: https://github.com/mapzen/geohash
and I've published it to Rubygems as c_geohash: https://rubygems.org/gems/c_geohash
(Note: If @davetroy or any other project maintainers would like me to move those updates into this repo, I'm glad to.)
c_geohash works on ruby 2.2.0 as well.