0

I try to call FSDirectory.open

FSDirectory.open(File.open('index', 'w+'))
NameError: no method 'open' for arguments (org.jruby.RubyFile) on Java::OrgApacheLuceneStore::FSDirectory

String gives a similar error.

1
  • java.io.File. If you want its methods, use it explicitly. Commented Dec 5, 2011 at 14:19

2 Answers 2

3

FSDirectory.open takes a java.io.File, which has no real equivalent in Ruby. Ruby's "File" represents an open file, while java.io.File simply represents a path. You should just use java.io.File in this case.

Sign up to request clarification or add additional context in comments.

Comments

1
FSDirectory.open(java.io.File.new('index'))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.