Forum: Ferret error of "no such file to load -- ferret_ext"

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ffecbcf66a00399a03521069f61c2902?d=identicon&s=25 Daniel Kehoe (fortuity)
on 2006-12-30 09:02
I've installed the latest version of Ferret (0.10.13) on Mac OS X 10.4.8
(Tiger) and I'm developing using Locomotive2. I installed with:
$ gem install ferret

I have a ferret_test.rb file:
require 'rubygems'
require 'ferret'
include Ferret
index = => '/opt/search-index')

I get an error when I run the test:
$ ruby test/ferret_test.rb
`gem_original_require': no such file to load -- ferret_ext (LoadError)
        from test/ferret_test.rb:2

How do I resolve this issue? What is "ferret_ext" and why isn't it here
after the gem install?

I've searched the forum and googled without finding more info.

-- Daniel
Bf2b5bfd50445978f8ecfdecc8ab3e0d?d=identicon&s=25 William Morgan (Guest)
on 2006-12-30 16:46
(Received via mailing list)
Excerpts from Daniel Kehoe's message of Sat Dec 30 00:02:56 -0800 2006:
> lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require': no such file to load -- ferret_ext (LoadError)

I saw this message when "gem install" was unable to compile the C part
of ferret. RubyGems is not very good about handling errors, and will
happily install the gem despite them.

Make sure you have gcc, make, etc. installed, remove and re-install the
gem, and pay close attention to any error messages that might indicate
compilation problems.
Ffecbcf66a00399a03521069f61c2902?d=identicon&s=25 Daniel Kehoe (fortuity)
on 2006-12-30 21:39
Thanks William Morgan! That was the tip I needed.

I had a stock install of Mac OS X Tiger, without developer tools
installed. When I did the "gem install ferret" I ignored the message
that gcc and make could not be found. RubyGems gave the message that
ferret was installed despite the fact that the C extensions were not
compiled and installed. So I got the error "no such file to load --
ferret_ext" when I tried to run ferret. Here's what I did to get ferret
to work:

Found my Mac OS X Tiger install disk and opened the Xcode Tools folder.
Clicked on the XcodeTools.mpkg. Started the install process and stopped
before I clicked the "Upgrade" button. Instead clicked the "Customize"
button and selected only "gcc 4.0" and the Software Development Kits
"Mac OS X SDK" and "BSD SDK" (I'm not developing Mac apps so didn't want
to crowd my disk with extra stuff I won't use). Then clicked "Upgrade."
What you need gets installed as /usr/bin/gcc plus lots more in
/usr/include. Now you can install ferret and it will compile the C

First I removed the broken ferret I installed earlier:
$ gem uninstall ferret

I checked that I had gcc:
$ which gcc

If you can't find it, check your bash shell path environment with:
$ env
You should have something like

I checked for the SDK libraries:
$ cd /usr/include
$ ls -lag
(should show lots of ".h" header files)

Then back to my development directory and ran:
$ sudo gem install ferret
Select which gem to install for your platform (powerpc-darwin7.9.0)
 1. ferret 0.10.13 (ruby)
Building native extensions.  This could take a while...
ruby extconf.rb install ferret
creating Makefile
(lots of make cruft)
make install
make clean
Successfully installed ferret-0.10.13
Installing ri documentation for ferret-0.10.13...
Installing RDoc documentation for ferret-0.10.13...

You can test ferret with this Ruby code in a file "ferret_test.rb"
require 'rubygems'
require 'ferret'
include Ferret
puts "ferret works!"

Try it with:
$ ruby ferret_test.rb
ferret works!

I hope this helps someone else who might be in a similar situation,
especially if they are googling for "no such file to load -- ferret_ext"
or "Mac OS X gem install ferret" or even "installing gcc on mac os x".

-- Daniel
This topic is locked and can not be replied to.