Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 1.9: Failed to build gem native extension. #1

Open
Stanley opened this issue Dec 19, 2009 · 19 comments
Open

Ruby 1.9: Failed to build gem native extension. #1

Stanley opened this issue Dec 19, 2009 · 19 comments

Comments

@Stanley
Copy link

Stanley commented Dec 19, 2009

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

@thbar
Copy link

thbar commented Aug 30, 2010

Hello Stanley,

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

@Stanley
Copy link
Author

Stanley commented Aug 30, 2010

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

@sticksnleaves
Copy link

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.

@danoyoung
Copy link

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$

@sticksnleaves
Copy link

Geohash is not 1.9 compatible.

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

@sergeych
Copy link

sergeych commented Oct 8, 2010

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?

@sticksnleaves
Copy link

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.

@sergeych
Copy link

sergeych commented Oct 8, 2010

thanks, got it working

@lantins
Copy link

lantins commented Oct 31, 2010

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

Thanks @sticksnleaves

@comp615
Copy link

comp615 commented May 15, 2011

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

@sticksnleaves
Copy link

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

@rud
Copy link

rud commented May 20, 2011

It would be awesome if a new gem-version was released with the latest fixes. Any chance of that? The 03d655d has been working great for a while for me.

@tmcw
Copy link

tmcw commented Sep 22, 2011

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

@sticksnleaves
Copy link

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

@oggy
Copy link

oggy commented Oct 8, 2012

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.

@10io
Copy link

10io commented May 3, 2013

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

@mmzoo
Copy link

mmzoo commented Sep 27, 2013

+1

@drewda
Copy link

drewda commented Nov 18, 2014

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

@bilow-factual
Copy link

c_geohash works on ruby 2.2.0 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests