louismullie / treat

Natural language processing framework for Ruby.
Other
1.36k stars 128 forks source link

Treat::Core::Installer.install returns LoadError #54

Closed jakobjanot closed 11 years ago

jakobjanot commented 11 years ago

First, thanks for a great piece of software. Lately I upgraded to treat 2.0.5.

Since then, I get the following error when running, 'require treat' and 'Treat::Core::Installer.install' in IRB LoadError: cannot load such file -- stanford-core-nlp from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in require' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:inrequire' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/loaders/stanford.rb:6:in <class:Stanford>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/loaders/stanford.rb:4:in<top (required)>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in require' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:inrequire' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/autoload.rb:22:in block in included' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/autoload.rb:22:ineach' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/autoload.rb:22:in included' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/modules.rb:13:ininclude' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/modules.rb:13:in <module:Loaders>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/modules.rb:13:inmodule:Treat' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat/modules.rb:1:in <top (required)>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat.rb:20:inrequire_relative' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat.rb:20:in <module:Treat>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/treat-2.0.5/lib/treat.rb:14:in<top (required)>' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in require' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:inrescue in require' from /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in require' from (irb):1 from /home/jaj/.rbenv/versions/1.9.3-p194/bin/irb:12:in

'

I haven't been able to find the cause of the problem

Best, Jakob

louismullie commented 11 years ago

Hello,

I don't have rbenv to test with, but what about gem install stanford-core-nlp -- does that fix the problem?

jakobjanot commented 11 years ago

Hi,

I am able to install stanford-core-nlp, but then I got another problem /home/jaj/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- open-nlp (LoadError) ... (skipped some lines)

Thus I also intalled the core-nlp gem - and that seems to solve all problems. I am now able to run require 'treat' Treat::Core::Installer.install in IRB without errors

Thanks, Jakob

2013/6/4 Louis Mullie notifications@github.com

Hello,

I don't have rbenv to test with, but what about gem install stanford-core-nlp -- does that fix the problem?

— Reply to this email directly or view it on GitHubhttps://github.com/louismullie/treat/issues/54#issuecomment-18905391 .

louismullie commented 11 years ago

Now I get what is causing this problem. Will fix tonight.

jakobjanot commented 11 years ago

Sounds perfect. Great software. Thanks for sharing it Den 04/06/2013 16.11 skrev "Louis Mullie" notifications@github.com:

Now I get what is causing this problem. Will fix tonight.

— Reply to this email directly or view it on GitHubhttps://github.com/louismullie/treat/issues/54#issuecomment-18911355 .

dmishh commented 11 years ago

temp fix: gem install open-nlp stanford-core-nlp

louismullie commented 11 years ago

Fixed in the latest release!

momer commented 10 years ago

This issue just happened with me - and after installing open-nlp stanford-core-nlp I get this error:

irb(main):005:0> par = "Mr. Cruz’s marathon session — which began Tuesday afternoon, went straight through the night and ended at a predetermined noon deadline — did not win over senators from either party, and in fact Mr. Cruz even voted to open debate. After the vote, Senator Mike Lee, Republican of Utah and a Cruz ally, said Mr. Cruz never intended to oppose the motion to take up the bill, a position contradicted by his words and procedural motions for days before the tally."
irb(main):006:0> a = phrase par
=> Sentence (70206555129340)  --- "Mr. Cruz’s marathon [...] the tally."  ---  {}   --- [] 
irb(main):007:0> a.children
=> []
irb(main):008:0> a.parse
Treat::Exception: Looking for StanfordCoreNLP library JAR files in /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/bin/stanford/, but it is not a directory. Please set the config option Treat.libraries.stanford.jar_path to a folder containing the appropriate JAR files.
    from /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/lib/treat/loaders/bind_it.rb:19:in `load'
    from /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/lib/treat/loaders/stanford.rb:8:in `load'
    from /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/lib/treat/workers/processors/parsers/stanford.rb:24:in `parse'
    from /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/lib/treat/entities/entity/delegatable.rb:66:in `call_worker'
    from /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/lib/treat/entities/entity/delegatable.rb:40:in `block (2 levels) in add_workers'
    from (irb):8
    from /Users/mo.omer/.rubies/ruby-1.9.3-p448/bin/irb:12:in `<main>'
agarie commented 10 years ago

Hey @momer, this line here:

Treat::Exception: Looking for StanfordCoreNLP library JAR files in /Users/mo.omer/.gem/ruby/1.9.3/gems/treat-2.0.7/bin/stanford/, but it is not a directory.
    Please set the config option Treat.libraries.stanford.jar_path to a folder containing the appropriate JAR files.

If you open irb and requite 'treat', what's the output of Treat.libraries.stanford.jar_path?

What's the output of ls $GEM_HOME/gems/treat-2.0.7/bin/stanford? I said 2.0.7, but it's the version you have installed (just update it to be sure).

louismullie commented 10 years ago

Yes, you need to have the JAR files here: Treat.libraries.stanford.jar_path.

You can download the JAR files by running Treat::Installer.install after requiring treat. Or, you can find links on the README here: https://github.com/louismullie/stanford-core-nlp

momer commented 10 years ago

Not sure if I was just vision impaired at the time of my comment, but I actually got this working last week following the treat lib install instructions on the readme. My apologies, and thank you for the gem.