Exiftool::ExiftoolNotInstalled (Exiftool::ExiftoolNotInstalled) after being installed - ruby

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.
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)
Also, it is running on my cmd. I tried testing it using the irb and the Exiftool isn't being recognized by ruby.

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:
If installed, remove exiftool_vendored.rb gem from your Windows system - it installs perl version of the exiftool from Phil Harvey.
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]
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
Create following Gemfile:
source 'https://rubygems.org'
gem 'exiftool', github: 'exiftool-rb/exiftool.rb', branch: 'win_support'
Run bundle install to get exiftool from that branch.
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.

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.

Related

killproc command not found error in Ubuntu 12.04

I have a redmine script in /etc/init.d/ folder which was working fine before I broke the ruby and rails packages link. Then I played with ruby gems and finally fixed the broken links. Then I tried to restart redmine script, But strangely, I got the below error
sudo service redmine stop
Shutting down redmine: /etc/init.d/redmine: line 49: killproc: command not found
user#studio:~$ sudo service redmine start
Starting redmine: /etc/init.d/redmine: /usr/local/bin/bundle: /usr/local/bin/ruby: bad interpreter: No such file or directory
/etc/init.d/redmine: line 35: echo_failure: command not found
killproc is part of init.d, so there isn't a missing package at play here. If the process isn't found, it won't run, as well.
However, the next line is more of a red flag. It sounds like your redmine installation is looking for ruby in the incorrect location. This may also be the source of the killproc error as it looks like redmine is not starting up properly.
You can get some more information by running which ruby and comparing that to the path that redmine is looking in. Reinstalling redmine may also resolve the path issue automatically since it sounds like you did a reinstall of rails earlier. Good luck.
My question has two answers, telemark already given answer for my 2nd problem ( ie, I had broken ruby links ). I solved path issues by uninstalling all ruby, rails and gem packages and reinstalled using apt repository. using rvm, chruby, etc everything failed when I switch between users. So I thought of going with the system ruby installation, relying on apt. Fortunately brightbox comes to the rescue.
https://www.brightbox.com/blog/2015/01/05/ruby-2-2-0-packages-for-ubuntu/
Using brightbox and apt solved my path issues.
Then, /etc/init.d/functions, this was missing. It says, No such file or directory. I searched in google and found this link
http://www.linuxfromscratch.org/lfs/view/6.4/scripts/apds02.html
I just copy pasted to /etc/init/functions and given execute permission
sudo chmod a+x /etc/init.d/functions
Thats it!.
UPDATE:
I forgot to mention one important thing, some functions like log_end_message, log_progress_message, etc are not available in functions file. So it's better to include . /lib/lsb/init-functions file.

Specify ruby version to use with Pik

I need to run two Ruby apps on a Windows 2008 server. So, I'm thinking to install Pik for the job (I understand I could use also RVM but the install process doesn't seem very 'stable' to me).
Before installing Pik, however, I'd like to know if there is a way to specify which Ruby version should be used for each app. Something like a .ruby-version file. I have looked for the answer on the official Pik repo but I couldn't find anything about it.
In my opinion, Ref 1, Ref 2 are the two simple references you could have to install different ruby versions using Pik in Windows.
After setting up the environment correctly, you could just use the command similar to RVM.
pik use ruby-2.0.0-p0
Then ruby -v will show ruby 2.0.0p0. So, for different projects, from with in each project folder choose which ruby you want to have.
Hope it helps :)

Linux Install RVM without using CURL

My current environment (including a corporate proxy) is not allowing me to install RVM with CURL or WGET for something reason. Is there another way to install RVM from source without these utilities? Every web search I've done returns the 'curl' way.
Any ideas?
modifying rvm scripts is not a good idea
I was thinking about your question/my answer while trying to sleep... and I couldn't get an eye closed without writing you another answer. Hacking the rvm install script is really not what you should do. Rvm uses curl everywhere (installation, downloading rubies, updating, ...). And you have to download many more things -- for example gems. Replacing every curl-call in every script is not maintainable.
proposed solution
The good thing about rvm is, that is stores all its data in the ~/.rvm directory. Considering this, you can install rvm on a remote computer (or VM), which is as similar as possible (same OS, same OS version, same libraries) to your development computer. Install all the rubies, gemsets and gems you need. Then move the zipped ~/.rvm directory to your development computer and unpack it to ~/.rvm.
Don't forget to do
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
to source rvm while loading your bash.
If you ever have to update or install gems or ruby versions, do your business on the remote computer, and copy ~/.rvm again.
my experience with this setup
I use this setup (although it is automated with our CI server) for ¬2 years now for a production environment which is in a similar wicked corporate network. Changing gems/rubies is harder than it should be, but it works without an internet connection.
Edit: Added a paragraph about my experience with this setup
You find the rvm install script here. You can
download it
modify the parts where curl is used
execute the script, which now refers to the manually downloaded files
1. Download
Download this file to /tmp/rvm-installer .
Now download the rvm.tar.gz file to /tmp/rvm-1.19.6.tar.gz
2. modify the file
At line 148 begins function fetch_version. Replace it with the following function:
fetch_version()
{
echo '1.19.6' # the current version, as of writing this
}
At line 161 (within install_release) the get_and_unpack function is called.
replace the function call with:
get_and_unpack \
/tmp/rvm-${_version}.tar.gz \
rvm-${_version}.tar.gz
At line 212 (within get_and_unpack) replace
__rvm_curl ${_url} -o ${rvm_archives_path}/${_file} ||
with:
mv ${_url} ${rvm_archives_path}/${_file} ||
3. finally install rvm
cd /tmp
cat rvm-installer | bash -s -- --version latest --autolibs=enabled
Disclaimer: This is still a hack. It installs rvm, but I don't know about updating (here rvm uses curl again). Good luck :)

Is there a nice and easy installer for Clojure on Mac OS (Leopard)?

I found the following guide:
http://mark.reid.name/sap/setting-up-clojure.html
but it seems like a whole lot of manual steps, and I bet it is out of date already. Installing ClojureBox on Windows was a breeze. Does anyone know of a simple installer for it? Where can I download it, and what are the steps?
Thanks!
EDIT: Tried installing cake, got:
$ sudo gem install cake
Password:
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302
Also tried installing using the script:
$ sudo ./cake_install.rb
http://github.com/ninjudd/cake-standalone/raw/master/jars/cake-0.5.4.jar
[=============================================================================]
http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar
[=============================================================================]
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
EDIT 2: Now the Java version issues :) What version of Java do I need and where to download it?
$ sudo cake test
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
My Leopard software is up to date :(
Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac. If you have problems with downloading, installing or using Java on Mac, please contact Apple Computer Technical Support.
EDIT: Hm ... I suspect that one of the suggestions I tried broke my ability to connect to the internet (both wired as well as wireless) on Apple :(
Clojure is also installable via Homebrew:
http://github.com/mxcl/homebrew
brew install clojure
If you just want to run clojure programs, then macports works. Bear in mind you're dependent upon the maintainer to update versions.
If you plan on writing clojure programs, then cake is a better starting point. Installation involves one of the following (your choice):
Using gem (easiest)
gem install cake
Standalone script
Download the script
Put it somewhere in your path and chmod +x cake to make it executable
Git repository
git clone git://github.com/ninjudd/cake.git
Symlink bin/cake into your path and make it executable
Cake is a full build system, but you can just use it to fire up the repl by running cake repl. There's also leiningen, but starting repls will feel faster in cake since it uses persistent JVMs.
I find Leiningen very easy to use. Just download the script, put it somewhere in your $PATH (/usr/bin/ for example) and make it executable: sudo chmod +x lein.
Now type lein repl and Leiningen will download all the files you need and create a REPL for you. It's that easy.
You may want to check CounterClockWise (an Eclipse plugin). There's a video on how to install it here. It'll give you a lot of features to play with - including a clojure REPL.
Just checked this will still work under Ubuntu. It should be the same for macs, except using whatever macs use instead of apt-get to install maven:
http://www.learningclojure.com/2010/08/clojure-emacs-swank-slime-maven-maven.html
You need to install maven, create a file, then you can just call mvn clojure:repl and everything should just work.
If you'd also like the whole emacs-swank-slime setup that's also easy now, and described there.
If you try it can you comment back here or on the blog to let me know if there are any changes I need to make for macs?
Install MacPorts and then run sudo port install clojure
I once created a package called ClojureX that was partly based on Mark's article. It's not actively maintained anymore (at least not by me), but there's no reason it wouldn't work:
http://github.com/citizen428/ClojureX

Installing Ruby on Mac 1.9.2, still getting 1.8.7 even though path changed

I'm on a Mac running 10.6.4 Snow Leopard, and apparently ruby comes ready to go. But I'm new to Ruby, trying to learn the Rails framework, and so i decided to install the latest version 1.9.2. I followed the instructions here, but after I compile and install, when I run ruby -v I'm still getting 1.8.7. Anyone can help a noob out?
When I use which ruby I am getting usr/local/bin/ruby, so the path has changed and is correct.
UPDATE:
It seems I was having issues because I was using two login files to set my path (.bash_login and .profile). You can only use one, and the first one that exists and is readable will be used. I eventually switched to RVM and used .bash_login to load RVM into shell.
Well, the sw isn't lying to you. So something is not as you expect.
Try /usr/local/bin/ruby -v and see what version it is.
Added: Also, try locate ruby|more to see where the ruby files are on your system.
You may need to change your path to use your newly installed copy of ruby.
Added more: did you add the Path to your ~/.profile file as the instructions tell you to do in step 1?
Did you restart your terminal session after changing the ~/.profile file? (Quit and restart terminal.)

Resources