Code Monkey home page Code Monkey logo

Comments (30)

millisami avatar millisami commented on May 28, 2024 3

I've a different case. In macOS mojave, in irb it is supported i.e. RGeo::Geos.supported? returns true but using bundle exec rails c, it returns false. Why is this different with bundler?

from rgeo.

johnlauck avatar johnlauck commented on May 28, 2024 2

For those using RVM, I fixed this by adding a global/user .rmvrc file

rvm_archflags="-arch x86_64"

You can also add to your .bashrc or .zshrc

export rvm_archflags="-arch x86_64"

After these are added reload your terminal.

Now uninstall the rgeo gem or bundle install if you are using Rails.

from rgeo.

dazuma avatar dazuma commented on May 28, 2024 1

Ah, okay, that explains it. RGeo doesn't know about those locations.

Try this. Uninstall rgeo, and then reinstall with this command:

gem install rgeo -- --with-geos-dir=/Library/Frameworks/GEOS.framework/unix --with-proj-dir=/Library/Frameworks/PROJ.framework/unix

I'll add these to the default search path in the next release.

from rgeo.

ghazel avatar ghazel commented on May 28, 2024 1

I see.

Well, I was able to install rgeo using sudo ARCHFLAGS="-arch x86_64" gem install rgeo and it built the extensions properly. That's good enough for me.

from rgeo.

robkooper avatar robkooper commented on May 28, 2024 1

For those using Postgres.app (http://postgresapp.com/) on the mac, the following got everything to compile for me with the latest versions (9.3.4.2 for postgres.app and 0.3.20 for rgeo). For some reason I had to specify the lib and include dirs separately.

sudo ARCHFLAGS="-arch x86_64" gem install rgeo -V -- --with-geos-include=/Applications/Postgres.app/Contents/Versions/9.3/include --with-geos-lib=/Applications/Postgres.app/Contents/Versions/9.3/lib --with-proj-include=/Applications/Postgres.app/Contents/Versions/9.3/include --with-proj-lib=/Applications/Postgres.app/Contents/Versions/9.3/lib

from rgeo.

benchi avatar benchi commented on May 28, 2024

I have been having this problem for a few days, and I have been unable to resolve it. I was about to uninstall GEOS, and in the process found this issue. Is there any workaround or solution? I REALLY care. If there's anything I can do, let me know.

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

I've been doing a little digging on this issue over the past few days and have determined that the issue has to do with 32-bit vs 64-bit binaries. The Snow Leopard supplied Ruby.framework appears (as far as I can tell) to be a universal binary, whereas you are probably building and installing a Geos that is x86_64 only. So the mkmf link check fails because it can't find 32-bit symbols in the Geos dylib. Probably the right way to solve this is to build Geos as a universal binary as well, but I haven't been able to figure out how to do that.

The easier workaround at this point is to install your own Ruby. (This is probably a good idea anyway, because Apple's system-supplied Ruby is woefully out of date.) Check out RVM (http://rvm.beginrescueend.com/) for the community-recommended way to manage Ruby installations. The reason this works is that if you build Ruby yourself (either via RVM or by downloading the source from ruby-lang.org) you're probably going to build a straight x86_64 binary rather than a universal binary, and that will link fine with an x86_64 Geos.

I'm going to leave this issue open for the time being until I have an answer on building Geos as a universal binary.

from rgeo.

benchi avatar benchi commented on May 28, 2024

Wow! Thanks for taking the time to write such a detailed response. I am actually already running RVM with updated ruby.

Here's what I see:

larry$ rvm ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
larry$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
larry$ rvm --version

rvm 1.6.23 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

So you're still seeing this issue even when running an rvm-installed ruby?

Can you verify the symptom here? Do this:

% irb
> require 'rgeo'
 => true
> RGeo::Geos.supported?
 => false
>

If you're getting that, then in which directory do you have Geos installed (i.e. what --prefix or package manager was used)?

from rgeo.

benchi avatar benchi commented on May 28, 2024

larry$ which ruby
/usr/local/bin/ruby
larry$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
larry$ irb
ruby-1.9.2-p180 :001 > require 'rgeo'
=> true
ruby-1.9.2-p180 :002 > RGeo::Geos.supported?
=> false

I used Kyngesburye's DMGs from: http://www.kyngchaos.com/software:frameworks, and I installed in default locations for both GEOS and Proj, which are:

larry$ which GEOS
/Library/Frameworks/GEOS.framework/GEOS
larry$ which PROJ
/Library/Frameworks/PROJ.framework/PROJ

from rgeo.

benchi avatar benchi commented on May 28, 2024

I figured that this was all I needed, but I googled endlessly to try to find these configuration options, and I couldn't. Instead of adding it to the default search path, try just adding these to the documentation. Thank you SO MUCH!!!

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

The path switches actually are in the readme, but I wasn't aware of the kyngchaos distributions so I didn't have the paths specific to those distributions documented.

from rgeo.

benchi avatar benchi commented on May 28, 2024

I should have read the README. I just kept trying to google for the answer. I apologize. RTFM strikes again.

from rgeo.

ghazel avatar ghazel commented on May 28, 2024

I am having this issue on Lion with the built in ruby and the Geos and Proj from Homebrew:

$ which ruby
/usr/bin/ruby

$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

$ brew install geos
==> Downloading http://download.osgeo.org/geos/geos-3.3.0.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/geos/3.3.0 --disable-debug
==> make install
/usr/local/Cellar/geos/3.3.0: 368 files, 8.9M, built in 3.0 minutes

$ brew install proj
==> Downloading http://download.osgeo.org/proj/proj-4.7.0.tar.gz
######################################################################## 100.0%
==> Downloading http://download.osgeo.org/proj/proj-datumgrid-1.5.zip
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/proj/4.7.0 --disable-debug
==> make install
/usr/local/Cellar/proj/4.7.0: 48 files, 5.6M, built in 23 seconds

$ which geos-config 
/usr/local/bin/geos-config

$ ls -l /usr/local/bin/geos-config 
lrwxr-xr-x  1 ghazel  staff  36 Sep  6 22:55 /usr/local/bin/geos-config -> ../Cellar/geos/3.3.0/bin/geos-config

$ geos-config --includes
/usr/local/Cellar/geos/3.3.0/include

$ which proj
/usr/local/bin/proj

$ sudo gem install rgeo
Building native extensions.  This could take a while...
Successfully installed rgeo-0.3.2
1 gem installed

$ irb
>> require 'rgeo'
=> true
>> RGeo::Geos.supported?
=> false

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

Greg, your issue, I believe, is an instance of the original issue here (see my comment #6 (comment) for details). The problem is one of linking your Geos and Proj4 libraries (which homebrew probably builds as 64-bit only) and the Lion-provided Ruby framework (which is probably universal). My recommendation is to build and install your own Ruby. (You can do this easily using RVM.)

from rgeo.

ghazel avatar ghazel commented on May 28, 2024

Isn't there a way to build only the 64bit version of the extension?

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

I believe the extension will build if you force it to build. However, Ruby's mkmf library (which directs building of extensions) will fight you the whole way, partly because it thinks that linking 64-bit to universal is problematic (which it can be in some cases), and partly because it doesn't look like it understands very well what universal means.

It may be possible to hack up RGeo's extension building script (extconf.rb) to detect this case and force the build through, assuming 64-bit. But I've been hesitant to do it, partly because I'm not sure I understand all the ramifications, but mostly because I expected that the vast majority of people were going to install their own ruby using rvm or whatnot, rather than trying to use the Mac OS built-in ruby.

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

Ah, good. I had actually tried setting ARCHFLAGS previously and had it fail on me, but I may have done something incorrectly. I'll try to get that working again.

from rgeo.

rubymaniac avatar rubymaniac commented on May 28, 2024

Hello there! I also having an issue with (maybe) the linking of rgeo with geos. I am on ubuntu 10.10 and build from source the latest geos and proj libraries (which installed libraries at /usr/local/lib). I am running

$ gem install rgeo -- --with-geos-dir=/usr/local/lib --with-proj-dir=/usr/local/lib
$ irb
>> require 'rgeo'
>> RGeo::Geos.supported?
=> false

I don't know what is wrong. Do you have a clue? Thanks!

from rgeo.

rubymaniac avatar rubymaniac commented on May 28, 2024

Solved it. I run

$ /usr/local/bin/geos-config --prefix
/usr/local

and put this in

$ gem install rgeo -- --with-geos-dir=/usr/local --with-proj-dir=/usr/local

from rgeo.

quidquid avatar quidquid commented on May 28, 2024

[Moved to https://github.com//issues/26]

from rgeo.

dazuma avatar dazuma commented on May 28, 2024

Hey folks, can we move the non-Mac OS X install issues to another issue? This is becoming a catch-all discussion and it'll never get resolved in that state. @quidquid can you create a separate issue for your problem? Thanks.

from rgeo.

wilsonsilva avatar wilsonsilva commented on May 28, 2024

@robkooper Your solution works.

from rgeo.

charlesdg avatar charlesdg commented on May 28, 2024

@johnlauck Thanks Dude! Worked for me

from rgeo.

no17436 avatar no17436 commented on May 28, 2024

@robkooper still helpful. Thanks!

from rgeo.

barrettclark avatar barrettclark commented on May 28, 2024

Thanks @robkooper. Still helpful with Postgres.app on PG 9.4 (just changed 9.3 to 9.4):

ARCHFLAGS="-arch x86_64" gem install rgeo -V -- \
--with-geos-include=/Applications/Postgres.app/Contents/Versions/9.4/include \
--with-geos-lib=/Applications/Postgres.app/Contents/Versions/9.4/lib \
--with-proj-include=/Applications/Postgres.app/Contents/Versions/9.4/include \
--with-proj-lib=/Applications/Postgres.app/Contents/Versions/9.4/lib

from rgeo.

deivid-rodriguez avatar deivid-rodriguez commented on May 28, 2024

This should work since the library path is now auto detected on installation.

from rgeo.

denispeplin avatar denispeplin commented on May 28, 2024

In some old project, where rgeo 0.3.20 is being used, I had to run sudo apt-get install libgeos-dev and to reinstall both rgeo and ffi-geos to solve the application mysterious crash on start. Thanks to this thread which revealed some details!

from rgeo.

jrreyes29 avatar jrreyes29 commented on May 28, 2024

I've a different case. In macOS mojave, in irb it is supported i.e. RGeo::Geos.supported? returns true but using bundle exec rails c, it returns false. Why is this different with bundler?

For me happen the same with irb I got true and with rails console I got false, why???

from rgeo.

humphreyja avatar humphreyja commented on May 28, 2024

I've a different case. In macOS mojave, in irb it is supported i.e. RGeo::Geos.supported? returns true but using bundle exec rails c, it returns false. Why is this different with bundler?

This one got me stuck for a little bit. Showed up after switching branches. Go into your activity monitor and kill any running ruby processes. Spring is probably causing some issues with memory here.

from rgeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.