I am trying to set up a tesseract-ocr gem in my rails environment. I ran brew install tesseract and then started installing the package in the application and everything works without errors, however, when I launch the application ( rails s ), the following error occurs:
/Users/xxxx/.rvm/gems/ ruby-1.9.2-p290@xxxx /gems/ffi-inline-0.0.4.3/lib/ffi/inline/compilers/gcc.rb:35:in `compile': compile error: see logs at /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log (CompilationError)
It refers to the following log file:
g++ -dynamic -bundle -fPIC -L/usr/local/Cellar/tesseract/3.02.02/lib -I/usr/local/Cellar/tesseract/3.02.02/include -o /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.dylib /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp -llept 2>>/var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp:1:10: fatal error: 'leptonica/allheaders.h' file not found
I followed these two issues: https://github.com/meh/ruby-tesseract-ocr/issues/3 and https://github.com/meh/ruby-tesseract-ocr/issues/21
He talks about setting up ENV vars, which I did. I created the test.rb file in the initalizers folder with the following sets:
ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include' ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib'
However, this does not matter for an error when starting the application.
I donβt understand what this means when it comes to updating the headers. I was wondering if anyone could tell me what to do to make this work.
Thanks.
source share