Search code examples
ruby-on-railsrubyruby-on-rails-4tesseract

Rtesseract throws error after installing rtesseract gem


I need to user rtessract gem for my ruby on rails project for OCR. I have installed the gem rtesseract using

gem install rtesseract

but when i try to use that gem in my console it throws rtesseract not found error

Can any one have any solution for that. I have also placed the same in gem file and ran bundle but it doesnt work


Solution

  • For RTesseract gem to work you need to install some dependencies like ImageMagick Leptonica and some gems like rmagick. you can install them using

    sudo apt-get install imagemagick leptonica
    

    and rmagick gem using

    gem install rmagick
    

    or by placing the same in your gem file

    You need to have tessdata folder in the

    /usr/local/share/tessdata
    

    if you dont have the tessdata you need to download tessdata from tesseract repositry and copy them to the above path