Rtesseract throws error after installing rtesseract gem - ruby-on-rails

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

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

Related

uglifier gem load error / download node.js?

I am getting started with Ruby on Rails, and following the steps at InstallRails... I have created the sample_app on the desktop, and now I cannot create the server.
My command
$ rails server
is answered with the following
...There was an error while trying to load the gem 'uglifier'. etc
I have read several threads here and elsewhere, such as this one and this one... In the latter there seems to bea solution, which I can't understand.... I cannot download node.js! or nodejs? What is my command and directory in Gitbash to download it?
It requires JS runtime.
Just install gem therubyracer for the JS runtime.
In the default rails Gemfile,uncomment the line for the gem 'therubyracer' which is commented out.If you dont find it add the gem to your Gemfile like
gem 'therubyracer'
Then run
bundle install
The gem will be installed and it should work.
Otherwise you can install node.js.
For ubuntu
sudo apt-get install nodejs
For mac
brew install nodejs

Rails 4 , ImageMagick and PaperClip

When i want to upload image i get this error:
1 error prohibited this movie from being saved:
Image Could not run the `identify` command. Please install ImageMagick.
I have this in Gemfile:
gem 'imagemagick-identify', '~> 0.0.1'
gem 'paperclip', '~> 4.2.1'
I ran from my console: gem install imagemagick-identify
imagemagick-identify is just a wrapper for imagemagick's identify program. You will need to install imagemagick separately from the gem.
If you are using debian/ubuntu you can do sudo apt-get install imagemagick.
If you are on a Mac, you may find this helpful.
If you are on Windows, you can find binaries to install here.
Looks like there are binaries for other platforms available at the last link as well.
If you have installed imagemagick and still get that error, make sure it is in your PATH.
if you are using cloud 9 ... there may be times just running
sudo apt-get install imagemagick --fix-missing
wont work. If that is your case, do
sudo apt-get update
first then install imagemagick after that

How do I make bundler recognize installed curb gem?

I've successfully installed the curb gem on Mac OS X using sudo env ARCHFLAGS="-arch x86_64" gem install curb but when trying to run bundle install I still get this error:
Installing curb (0.7.16) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
I've done some digging and it looks like feedzirra is requiring the gem (it's not listed in the Gemfile). I've tried adding the gem to the Gemfile and pointing it to vendor/gems but that didn't help.
Any help would be greatly appreciated. Also, sorry if there's more clarification needed. This is my first question and I'm fairly new to Ruby on Rails. I'll be glad to provide more details if necessary.
Apparently it needs SSL support for curl, as I had the same error and fixed it with:
sudo apt-get install libcurl4-openssl-dev
You might want to try a standard "gem install curb" to see if that works before "bundle install".
in your Gemfile:
gem 'curb', '= 0.7.16', :path => 'vendor/gems/curb'
As long as that's where you installed the gem to.

Install a gem from a downloaded tar or zip

First let me say I cannot do gem install, I don't know why. Probably because I live in China and the firewall random things.
So I have to locally install gems. For example, i want to install this gem riddle. But this gem downloads as a tar or zip and when i open it it is a folder not a .gem file.
So what to do?
You can do gem build whatever.gemspec inside of the directory that you untar/unzip -- that will produce a .gem file, then do gem install whatever.gem.
You need to be at the directory where you unzip the gem file for example
C:\railsinstaller\ruby2.2.0\lib\ruby\gems\2.2.0\gems> gem install rails-5.0.0.1.gem
and that's it - you are done downloading and installing Rails.
To avoid the gem build step, and to always run the actual code, bundler can install from a local path:
gem 'pry', path: './pry'
in a Gemfile.
... where ./pry would be the clone of your repository.
Simply run bundle install once, and any changes in the gem sources you make are immediately reflected. With gem build pry / gem install pry/pry.gem, the sources are still moved into GEM_PATH and you'll always have to run both gem build pry and gem update again if you make changes.

Netbeans doesn't recognize ruby gems installed using Terminal

I have installed a GEM called "Ziya" using the terminal in Mac OSx. However, when I open the application using the Netbeans, it says that the GEM cannot be found.
If I install Ziya using the GEM manager, I get the following error and the GEM doesn't get installed,
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/snehal/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
UPDATE: The GEM is installed in my machine. But Netbeans can't recognize it.
Thanks,
Snehal
do u have the appropriate permission to write to the folders? try to do a
sudo gem install Ziya
and see if it works =)

Resources