dbalmain / ferret

Ferret: the extensible information retrieval library for ruby.
http://ferret.davebalmain.com
MIT License
279 stars 59 forks source link

Where is the setup.rb file? #8

Closed sjqtentacles closed 9 years ago

sjqtentacles commented 9 years ago

Hello all,

I was having some trouble with ferret after successfully installing with rubygems, so I decided to try it with the manual approach of $ruby setup.rb config

But I noticed that there is no such file 'setup.rb' in the repo.

Any idea what I should do?

I keep getting the ferret error of

/blah/blah/app.rb:9:in `require': cannot load such file -- ferret (LoadError)

This error occurs in the header of a ruby script, I'm simply importing the ferret library with

require 'ferret'

Here's the log of the successful gem installation.

$ sudo gem install ferret
Password:
Building native extensions.  This could take a while...
Successfully installed ferret-0.11.8.6
Parsing documentation for ferret-0.11.8.6
Done installing documentation for ferret after 5 seconds
1 gem installed
dbalmain commented 9 years ago

Hey Allen, sorry those instructions are a bit outdated. You can try running rake install from the ruby directory but I doubt it would make a difference. I'm not sure why you're having this problem. Are other gems working correctly? Did you try requiring rubygems before? eg.

require "rubygems"
require "ferret"

Otherwise, I'm not sure what the problem is.

sjqtentacles commented 9 years ago

Thanks for the quick reply on that. I tried everything and it can't seem to get past this requirement.

All other gems seem to be working properly, I did include rubygems in the requirements before ferret (this was in the original code) and no difference was made. It's really an odd problem.

I'm coming from a python background so I'm not entirely familiar with Ruby (yet) but I'm learning. Is there an equivalent method of simply importing this library from a local directory? For example in python if I wanted to use a script '/script/app.py' I would simply put 'from script import app' and it would work from there. Is there an equivalent solution for running ferret?

Sorry if this question comes off as rather noobish.

dbalmain commented 9 years ago

Ah, I think I might know the answer. Do you have ruby installed with rbenv or rvm by any chance? It's possible you're installing ferret in your global environment and then sourcing your gems from the local gem store. For example, I'm running Ubuntu 15.04 and I have ruby 2.1 installed globally but I have ruby 2.2 via rbenv running locally. If I do sudo gem install ferret it will install it for the ruby 2.1 environment, not the 2.2 environment. I need to do a gem install ferret.

Try this

$ git clone https://github.com/dbalmain/ferret.git
$ cd ferret/ruby
$ rake build
$ gem install pkg/ferret-0.11.8.7.gem
sjqtentacles commented 9 years ago

Not sure about that pkg/ferret-0.11.8.7.gem line, didn't work.

BUT, I just tried updating the rubygems and it somehow works...

Here's a copy/paste of my command history.

  486  sudo gem update --system
  487  sudo gem install rubygems-update
  488  sudo gem install ferret

I'm not sure why updating rubygems fixed this, but I'm glad it worked. Thanks for the help.

dbalmain commented 9 years ago

Great! Happy it's working for you now. :-)