Home > other >  Exiftool::ExiftoolNotInstalled (Exiftool::ExiftoolNotInstalled) after being installed
Exiftool::ExiftoolNotInstalled (Exiftool::ExiftoolNotInstalled) after being installed

Time:02-12

I'm trying to run a ruby script where I used the exiftool gem, and everytime I'm trying to run it I keep getting this error even after installed it. Also, after running bundler as well.

enter image description here

Traceback (most recent call last):
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/exiftool-1.2.4/lib/exiftool.rb:60:in `initialize': Exiftool::ExiftoolNotInstalled (Exiftool::ExiftoolNotInstalled)

enter image description here

Also, it is running on my cmd. I tried testing it using the irb and the Exiftool isn't being recognized by ruby.

enter image description here

CodePudding user response:

Looks like the exiftool gem does not currently support windows environments. It often appends 2> /dev/null/ when running shell commands.

You could potentually try running the script under WSL, or could try invoking the commands directly.

CodePudding user response:

I'm maintainer of the exiftool.rb and exiftool_vendored.rb repos. @Zeragamba is correct that gem doesn't support Windows environments. The need for running it on Windows hasn't been brought up to our attention in the past 10 years. I've looked at the issue and cut a separate branch that should work with Windows, however I'm not planning to fully support Windows unless there is an overwhelming demand. There are a few gotchas related to implementing Windows support and I'm not sure if it's worth the time and effort to solve them at this point.

Couple of things that you would need to do to get it working:

  1. If installed, remove exiftool_vendored.rb gem from your Windows system - it installs perl version of the exiftool from Phil Harvey.

  2. Make sure that you are able to run git client commands in your PowerShell prompt

I've tested the following setup on Windows 10 and ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x64-mingw32]

  1. Download and install Windows executable from Phil Harvey's Exiftool site make sure that exiftool is in your PATH and can be executed in the PowerShell

  2. Create following Gemfile:

source 'https://rubygems.org'
gem 'exiftool', github: 'exiftool-rb/exiftool.rb', branch: 'win_support'
  1. Run bundle install to get exiftool from that branch.
  2. Create a test.rb file to test test the installation:
require 'exiftool'

puts "Exiftool command: #{Exiftool.command}"
puts "Is Exiftool Installed?: #{Exiftool.exiftool_installed?}"
puts "Exiftool version: #{Exiftool.exiftool_version}"

After running it you should get something along these lines:

PS C:\Users\sergey>ruby .\test.rb
Exiftool command: exiftool
Is Exiftool Installed?: true
Exiftool version: 12.40

Once again please keep in mind that this isn't an official version that supports Windows environment. Feel free to open an issue on the github if you strongly feel that gem needs to support Windows environments, PRs are always welcome as well.

Thanks.

  • Related