geohash icon indicating copy to clipboard operation
geohash copied to clipboard

Ruby 1.9: Failed to build gem native extension.

Open Stanley opened this issue 15 years ago • 19 comments

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

Stanley avatar Dec 19 '09 18:12 Stanley

Hello Stanley,

did you manage to compile geohash ? I meet the same issue today with 1.9.2.

thbar avatar Aug 30 '10 09:08 thbar

No. I did not. Sorry. There is another geohash lib though: http://github.com/masuidrive/pr_geohash

Stanley avatar Aug 30 '10 20:08 Stanley

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.

sticksnleaves avatar Sep 02 '10 00:09 sticksnleaves

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$

danoyoung avatar Sep 16 '10 19:09 danoyoung

Geohash is not 1.9 compatible.

Use my fork: http://github.com/sticksnleaves/geohash

sticksnleaves avatar Sep 16 '10 20:09 sticksnleaves

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?

sergeych avatar Oct 08 '10 17:10 sergeych

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.

sticksnleaves avatar Oct 08 '10 17:10 sticksnleaves

thanks, got it working

sergeych avatar Oct 08 '10 17:10 sergeych

Aha! Had the same issue with rubygems version, github repo version working fine on ruby 1.9.1p376 here =)

Thanks @sticksnleaves

lantins avatar Oct 31 '10 00:10 lantins

@sticksnleaves I can't get to your repo. Does anyone still have a copy of this somewhere?

comp615 avatar May 15 '11 15:05 comp615

@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.

sticksnleaves avatar May 15 '11 18:05 sticksnleaves

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.

rud avatar May 20 '11 07:05 rud

@sticksnleaves I'm not seeing 1.1.1 available on the GitHub listing either. What was your fork merged into? This repo?

tmcw avatar Sep 22 '11 21:09 tmcw

Yes, my fork was merged into davetroy/geohash master branch. As far as I know it was never packaged into a gem.

sticksnleaves avatar Sep 22 '11 21:09 sticksnleaves

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.

oggy avatar Oct 08 '12 14:10 oggy

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

10io avatar May 03 '13 16:05 10io

+1

mmzoo avatar Sep 27 '13 08:09 mmzoo

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.)

drewda avatar Nov 18 '14 18:11 drewda

c_geohash works on ruby 2.2.0 as well.

bilow-factual avatar Aug 01 '16 20:08 bilow-factual