Error setting up the tesseract OCR in gem in rails

会有一股神秘感。 提交于 2019-12-04 16:54:45

Also had the same error. I solved it by installing the dev packages for tesseract and leptonica.

For debian based systems

sudo apt-get install libleptonica-dev libtesseract-dev

For redhat base systems

sudo yum insall leptonica-devel tesseract-devel

That solved the problem for me.

MintDeparture

I've fixed this...

Just in case anyone else has a problem here's exactly how it was fixed in mine:

Firstly had to run both:

brew install tesseract

and

brew install leptonica

Then in the Gemfile NOT in an initializer you have to put both paths to the libraries as env vars:

ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include -I/usr/local/Cellar/leptonica/1.69/include' 
ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib -L/usr/local/Cellar/leptonica/1.69/lib'

Had this issue (OS X El Capitan). Fixed by downgrading tesseract with

brew uninstall --force tesseract
brew install https://raw.githubusercontent.com/Homebrew/homebrew/8ba134eda537d2cee7daa7ebdd9f728389d9c53e/Library/Formula/tesseract.rb

and updating xcode

xcode-select --install
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!