problems with gem installation with rvm and OS X Lion

72 views
Skip to first unread message

David Lowenfels

unread,
Jun 18, 2012, 5:31:13 PM6/18/12
to picky...@googlegroups.com
Hi, 
  I'm trying to get picky to install. I'm using RVM on OS X Lion.

bundle install reports "Your bundle is complete!" with no errors, but when I require 'picky'
I get the compilation from picky-4.4.1/lib/picky/ext/maybe_compile.rb
the compiled bundle is there and I even did a make install

but still 'ruby19/performant' is not being loaded, as evidenced below:

(bash)[dfl@cosminyah gearroom]$ irb
ruby-1.9.3-p194 :001 > require 'picky'
Compiling with Ruby 1.9
checking for ruby.h... yes
creating Makefile

.... never ends, have to ctrl-C out of it

Any hints on how to get this to work?
I'd like to use picky but if I can't install it I'll have to go back to solr or sphinx :(

Thanks,
David

David Lowenfels

unread,
Jun 18, 2012, 5:33:29 PM6/18/12
to picky...@googlegroups.com
 PS I'm using ruby-1.9.3-p194

Picky / Florian Hanke

unread,
Jun 18, 2012, 7:58:13 PM6/18/12
to picky...@googlegroups.com
Hi David,

Thanks for the feedback. Let's find out how to make this work together.

That sounds curious. So the line require_relative 'ruby19/performant' in maybe_compile.rb raises a LoadError, with the compiled bundle being there?
So (sorry if this is a stupid question) the "performant.bundle" file is there, in a ruby19 directory which is next to the maybe_compile.rb file?
Do you have multiple Pickies installed, and you might not look at the one that is actually used?

We'll figure this out :) Cheers,
   Florian

David Lowenfels

unread,
Jun 18, 2012, 8:01:02 PM6/18/12
to picky...@googlegroups.com
Hi Florian, thanks for your quick response.

On Jun 18, 2012, at 4:58 PM, Picky / Florian Hanke wrote:

> Hi David,
>
> Thanks for the feedback. Let's find out how to make this work together.
>
> That sounds curious. So the line require_relative 'ruby19/performant' in maybe_compile.rb raises a LoadError, with the compiled bundle being there?
> So (sorry if this is a stupid question) the "performant.bundle" file is there, in a ruby19 directory which is next to the maybe_compile.rb file?
yes, that's correct

> Do you have multiple Pickies installed, and you might not look at the one that is actually used?
not that I'm aware of.
I tried to install it in my global rvm as well as my gemset, but had the same issues

Meanwhile, I'm discovering that postgres full text search might be good enough for now…
but I would like to play around with Picky anyways, it seems like a cool project that I want to support.

-D

Picky / Florian Hanke

unread,
Jun 18, 2012, 9:06:49 PM6/18/12
to picky...@googlegroups.com
Hi David,

My pleasure.

Glad to hear Postgres fulltext is already working well. Picky fills a completely different spot in that it is less about full text, and more about semantic searching.
Also, happy to hear you want to support the project :) The best support currently comes from blog posts by happy customers (of which there are many, but none are avid blog writers, sadly).

What happens if you create a new Ruby file with "require_relative 'ruby19/performant'" in it, with the compiled bundle in a ruby19 dir next to it, and run the Ruby file – does it load or do you get a load error?
(Sorry this is so basic, but I think it's good to verify from the ground up – I want to be really sure that this works in the most basic environment. And if not, why not.)

Cheers,
   Florian

David Lowenfels

unread,
Jun 21, 2012, 2:09:40 AM6/21/12
to picky...@googlegroups.com
looks like maybe the bundle isn't being properly compiled for my system?

(bash)[dfl@cosminyah ext]$ ls ruby19/
Makefile extconf.rb mkmf.log performant.bundle* performant.c performant.o
(bash)[dfl@cosminyah ext]$ cat > foo.rb
require 'ruby19/performant'
^C
(bash)[dfl@cosminyah ext]$ ruby foo.rb
/Users/dfl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- ruby19/performant (LoadError)
from /Users/dfl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from foo.rb:1:in `<main>'

Florian Hanke

unread,
Jun 21, 2012, 2:22:43 AM6/21/12
to picky...@googlegroups.com
What does the asterisk in the filename mean in this case?

David Lowenfels

unread,
Jun 21, 2012, 2:24:42 AM6/21/12
to picky...@googlegroups.com
it means it's executable

Florian Hanke

unread,
Jun 21, 2012, 2:27:29 AM6/21/12
to picky...@googlegroups.com
Ah, thanks. I just noticed something: Use require_relative, not require, please, since that is what I use in Picky. (Or add the current dir to the load path, also an option, with require)

David Lowenfels

unread,
Jun 21, 2012, 2:30:11 AM6/21/12
to picky...@googlegroups.com
(bash)[dfl@cosminyah ext]$ cat > foo.rb
require_relative 'ruby19/performant'
^C
(bash)[dfl@cosminyah ext]$ ruby foo.rb
foo.rb:1:in `require_relative': dlopen(/Users/dfl/.rvm/gems/ruby-1.9.3-p194@gearroom/gems/picky-4.4.1/lib/picky/ext/ruby19/performant.bundle, 9): Symbol not found: _memory_efficient_intersect (LoadError)
Referenced from: /Users/dfl/.rvm/gems/ruby-1.9.3-p194@gearroom/gems/picky-4.4.1/lib/picky/ext/ruby19/performant.bundle
Expected in: flat namespace
in /Users/dfl/.rvm/gems/ruby-1.9.3-p194@gearroom/gems/picky-4.4.1/lib/picky/ext/ruby19/performant.bundle - /Users/dfl/.rvm/gems/ruby-1.9.3-p194@gearroom/gems/picky-4.4.1/lib/picky/ext/ruby19/performant.bundle
from foo.rb:1:in `<main>'

Florian Hanke

unread,
Jun 21, 2012, 3:01:49 AM6/21/12
to picky...@googlegroups.com
What if you go into the gem directory, from there into lib/picky/ext/ruby19, then call ruby extconf.rb, then simply make. What output do you get? Thanks!

David Lowenfels

unread,
Jun 21, 2012, 3:03:36 AM6/21/12
to picky...@googlegroups.com
(bash)[dfl@cosminyah ruby19]$ ruby extconf.rb
Compiling with Ruby 1.9
checking for ruby.h... yes
creating Makefile
(bash)[dfl@cosminyah ruby19]$ make
linking shared-object performant.bundle
(bash)[dfl@cosminyah ruby19]$ make clean
(bash)[dfl@cosminyah ruby19]$ make
compiling performant.c
performant.c:58:22: warning: incompatible integer to pointer conversion assigning to 'struct RArray *' from 'VALUE' (aka 'unsigned long')
rb_array_of_arrays = rb_block_call(unsorted_array_of_arrays, rb_intern("sort_by!"), 0, 0, rb_ary_length, 0);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
linking shared-object performant.bundle

Picky / Florian Hanke

unread,
Jun 21, 2012, 3:45:29 AM6/21/12
to picky...@googlegroups.com
It's baffling. This looks perfect (yes, the warning's cause needs to be eliminated, but it should work already). Any ideas? Does Ruby require not recognize .bundle Files anymore?

David Lowenfels

unread,
Jun 21, 2012, 6:56:36 PM6/21/12
to picky...@googlegroups.com
turns out this is related to LLVM gcc (aka clang) with the latest Mac Developer tools.
ruby-1.9.3 gets compiled with this.

Looks like I fixed the problem by changing the makefile to point to gcc-4.2 (which I installed with homebrew: brew install apple-gcc42)

CC = gcc-4.2
CXX = gcc-4.2

ruby-1.9.3-p194 :001 > require 'picky'
=> true

David Lowenfels

unread,
Jun 21, 2012, 7:10:34 PM6/21/12
to picky...@googlegroups.com
looks like my plain gcc (rather than homebrew version) also works (gem gets loaded with no errors)

(bash)[dfl@cosminyah ext]$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

if you added this to extconf.rb:
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

then I could do this:
CC=gcc gem install picky
c.f. http://stackoverflow.com/questions/4554837/how-to-specify-compiler-for-gem-install

otherwise it forces to the system default compiler which is clang.

Picky / Florian Hanke

unread,
Jun 21, 2012, 8:51:32 PM6/21/12
to picky...@googlegroups.com
Thanks David for your patience and great work!

I'd like to find out what clang's problem is. Did you get any feedback at all? Is it harsher with warnings? (Yes, I need to remove that warning, but still)

For version 4.4.2, I added your suggestion, including some output which tells you which gcc was used. However, I need to investigate first: https://github.com/floere/picky/issues/81.

Cheers,
   Florian

Picky / Florian Hanke

unread,
Jun 21, 2012, 9:31:23 PM6/21/12
to picky...@googlegroups.com
P.S: Version 4.4.2 is released.
Reply all
Reply to author
Forward
0 new messages