Tesseract developers changed quite some stuff in version 3.0.4 and tesseract-ocr gem lost compatibility with it. The best solution I see is to downgrade for now. You may have previous versions of Tesseract installed on your mac, use brew info tesseract to find that out. If so, just use brew switch. I did brew cleanup recently, so I had to uninstall tesseract and install it from the old formula, like so:
Then do the Enabling and various settings of the add-on.
1 2 3 4 5 6 7 8
heroku addons: create Mongolab: sandbox
heroku addons: create Sendgrid: Starter
heroku config: createheroku = truebundle EXEC rake secret heroku config: createSECRET_TOKEN = "$ (bundle EXEC rake secret)" replaced with the host name that has been created by the # heroku create heroku config: set ERRBIT_HOST = Xxxx.herokuapp.com
# error mail From (Recommended is given to the distribution and easy addy) heroku config: set ERRBIT_EMAIL_FROM = example@example.com
When you have finished setting screen, then push to heroku.
I would use this solution for large database, i take it from geocoder gem rake task: You can refine this for your needs. Some example create rake task:
namespace :geocode_my_data do
desc "Geocode all objects in my databse."
task all::environment do
klass =User
klass.where(geocoded:false).find_each(limit:100)do|obj|
obj.geocode; obj.save
endendend
$> rake geocode_my_data:all
Used below code and put it into my lib/tasks folder as geocode_my_data.rake To run:
rake geocode:all CLASS=YourModel
Works great!
namespace :geocode_my_data do
desc "Geocode all objects without coordinates."
task :all =>:environment do
class_name = ENV['CLASS']|| ENV['class']
sleep_timer = ENV['SLEEP']|| ENV['sleep']
raise "Please specify a CLASS (model)"unless class_name
klass = class_from_string(class_name)
klass.not_geocoded.find_each(batch_size:100)do|obj|
obj.geocode; obj.save
sleep(sleep_timer.to_f)unless sleep_timer.nil?endendend### Get a class object from the string given in the shell environment.# Similar to ActiveSupport's +constantize+ method.#def class_from_string(class_name)
parts = class_name.split("::")
constant =Object
parts.each do|part|
constant = constant.const_get(part)end
constant
end