louismullie / stanford-core-nlp

Ruby bindings to the Stanford Core NLP tools (English, French, German).
Other
432 stars 70 forks source link

Default [...]/bin path is incorrect when using .rbenv #7

Closed hale closed 11 years ago

hale commented 12 years ago

Using rbenv and ruby version 1.9.3-p194, the bin folder is set to be [...]/versions/1.9.3-p194/ruby/gems[...] resulting in this error:

RuntimeError: Could not find JAR file (looking in /home/phil/.rbenv/versions/1.9.3-p194/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.2/bin/joda-time.jar).

The bin path with rbenv is actually:

/home/phil/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/stanford-core-nlp-0.3.2/bin/

I'm not sure if it's just rbenv that acts in this way, but it would be nice not to have to configure everything to use the different paths.

hale commented 12 years ago

It can be temporarily fixed with symlinks, or by specifying the JAR files using the config options. This is also a problem in Treat for the same reason.

louismullie commented 12 years ago

Thanks for the report. We're using File.dirname(__FILE__) to detect the path in which the gem is found. I don't quite understand why that would not give the right result using rbenv - is there a command that would work both in traditional Ruby/RVM as well as RBenv?

hale commented 12 years ago

I have no idea unfortunately! Really strange. It's the kind of thing I'm hesitant to debug as well, since 'experimenting' with my development environment is bound to end in tears.

Not sure if this is related: https://github.com/sstephenson/rbenv/issues/234

It seems there's a few bug reports over there about the PATH. Perhaps it's an issue with how they 'sandbox' Ruby.

louismullie commented 12 years ago

OK, I will look into this when I have time to install rbenv and debug it.

louismullie commented 11 years ago

Closing this, most people should be using RVM.