Closed loshlee closed 2 years ago
@loshlee I'm sorry you're having this problem. It appears your $PATH
environment variable does not include the path to your Gems.
How did you originally install the video_trancoding
Gem? And how did you install Ruby itself?
Thanks. I used Rob Griffiths' instructions. https://robservatory.com/detailed-instructions-for-installing-the-transcode-video-tools/
@loshlee OK, apparently you've used sudo
to install the Gem so transcode-video
should be somewhere in your system library path. But instead, transcode-video
or a "stub" for it is inside your /usr/local
directory. So, you must have used a different method to install it sometime in the past.
My advice is to manually remove all versions of the tools and other files included in the video_transcoding
Gem no matter where they might be on your system. And then try to install them again.
Do you have the list of what to look for and where?
(gem install video_transcoding Fetching video_transcoding-0.25.3.gem ERROR: While executing gem ... (Gem::FilePermissionError))
"You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory." That would appear to be a conflict with the double system disk method of Catalina and up. How would I give that the necessary permissions?
@loshlee Right. You can't install in the system library that way. You need to:
sudo gem install video_transcoding
See the sudo
prefix?
Did you remove all previously installed versions first?
I'm trying to find them. Would it be anything with "ruby" or "gem" in the path? Thanks.
That's not quite what I meant, sorry. Would it be all files nested in folders named "ruby", "gem", and "ruby.framework"? Others? Thanks.
I don't mind deleting other needed files, I can do an overlay system install, if needed.
@loshlee You can try this to remove the version in the system, if it's there:
sudo gem uninstall video_transcoding
As for other versions, I'm not sure where they might be installed. Maybe somewhere inside this path:
/usr/local/lib/ruby/gems/
@loshlee I suspect you got yourself into this predicament by improperly updating your Gems. Remember, if you use sudo
to install as the guide you linked to recommended, then you need to use sudo
when you update. Or it's kinda random where they'll go.
If you were on anything other than a super fast M1, I wouldn't suggest this, but you can search your entire system for "transcode", which I assume will only be found in files related to Don's script.
find / -name "*transcode*" 2>/dev/null
The 2>/dev/null
is to silence all the "Permission denied" sections of the system that your user isn't allowed to look into.
Oh, and you should make sure you don't have any network shares mounted before you run that.
Thanks. "sudo find -x /" should take care of that.
@loshlee Remember that you're not just looking for stray versions of transcode-video
. The video_transcoding
Gem also contains the convert-video
, detect-crop
and query-handbrake-log
tools.
Went with
sudo find /opt -name "*transcode*" -print -exec open -R {} ';';sudo find /usr -name "*transcode*" -print -exec open -R {} ';';sudo find /Library -name "*transcode*" -print -exec open -R {} ';'
Anything need to be removed that's nested in folders other than "/opt", "/usr", or "/Library"? I'm assuming I don't need to worry about anything with "ffmpeg" or "commandlinetools" in its path, right?
Perhaps this isn't the most constructive approach.
It might be worth while to first determine if there's an issue with your system running transcode-video
in the first place.
Can you save the Ruby script to your home directory, and attempt to run it directly?
For example:
wget https://raw.githubusercontent.com/donmelton/video_transcoding/master/bin/transcode-video
chmod a+x transcode-video
./transcode-video
On a side note, I notice that you've opened this issue in the other_video_transcoding
repository, but seem to be referring to the video_transcoding tool. Is there a particular reason you're wanting to use the older video_transcoding
tool instead of other_video_transcoding
?
Dyslexia?
My point, I suppose, is that trying to troubleshoot an issue with an older tool (video_transcoding
) that is no longer in active development on a system that is brand new might not be the most useful approach if other_video_transcoding
is a tool that meets your needs. I realize that folks might have good reasons to want to use video_transcoding
, which is why I asked. :)
Most of us have significantly more expertise with other_video_transcoding
, especially on newer hardware and operating systems.
Thanks. Yes, I think I'm talking about other_video_transcoding, I'm not sure I really ever made the distinction. I may be confused by the fact that I use an executable called transcode-video and I'm far more occupied with the options for that executable than I am for the configurations needed to implement it.
I think I've removed what I need to remove, but I'm left with the condition that:
sudo gem install video_transcoding
yields
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
Which tool does the transcode-video executable belong to, other_video_transcoding
or video_transcoding
? I think it's other_video_transcoding
, right? I guess my issue just has the wrong title. I know Don tweeted recently that he had released version 10. I installed that, and it was working fine until my 16 in. MacBook Pro arrived, then a few days later Homebrew was updated to recognize the difference between x86 and ARM. I've been trying to acclimate to those changes, and it's proving to be quite a strain on my capabilities. I'll try pretty much anything, I don't know why the gem installer would bother to tell me I can't write to a /System subfolder when everyone know nothing inside that has been writeable since Catalina.
I'm sorry, I confused everybody. It may be dyslexia. The gem command that is actually failing (with the same error) is:
sudo gem install other_video_transcoding
So, forgetting about gem install
for a moment, can you run other-transcode
just as a standalone script?
wget https://raw.githubusercontent.com/donmelton/other_video_transcoding/master/bin/other-transcode
chmod a+x other-transcode
./other-transcode
@loshlee You had that backwards in your previous comment. Just to be clear...
The video_transcoding
Gem contains transcode-video
, convert-video
, detect-crop
and query-handbrake-log
. These tools are built around HandBrakeCLI
. However, as @ttyS0 mentioned, this Gem is no longer in active development. In fact, I haven't updated it in years. I no longer recommend using it.
The other_video_transcoding
Gem contains other-transcode
and ask-ffmpeg-log
. These tools are built around ffmpeg
. This Gem is maintained and updated regularly. This is the Gem you should be using.
@loshlee The always helpful @ttyS0 is correct. You can install other-transcode
without actually installing the Gem. That's because other-transcode
is actually contained in a single file.
Thanks. I want to use transcode-video (my question above was "Which tool does the transcode-video executable belong to", so that's the most recent point at which I checked my executable's file name to be sure.) I've read elsewhere that "brew install ruby" provides an answer, but that's not the case for me. The "ERROR" tells me that I can't write to 2.6.0 inside the gems folder, all of which is nested inside /System. The question would seem to be why not the later ruby gems installed under homebrew instead of the old one nested in /System. That's why I think it's related to the change implemented by the most recent Homebrew. Still looking for the answer. Thanks for your help.
@loshlee I'm sorry we weren't able to help more. But we really can't inspect your system to diagnose your Ruby installation. Since this question really has to do with a tool in a different project, I'll close this now. I hope you're able to solve this on your own.
Here may or may not be progress:
/opt/homebrew/Cellar/ruby/3.0.3/bin/gem install other_video_transcoding
Fetching other_video_transcoding-0.10.0.gem
Successfully installed other_video_transcoding-0.10.0
Parsing documentation for other_video_transcoding-0.10.0
Installing ri documentation for other_video_transcoding-0.10.0
Done installing documentation for other_video_transcoding after 0 seconds
1 gem installed
zsh doesn't allow me to run transcode-video, so my path probably doesn't include its containing folder. Now I need to find where it's installed and whether the installation is viable. I'll start by searching for the transcode-video executable.
Yeah, I still don't have it straight. Where does the transcode-video executable come from? Is it the other-transcode package, or the other_video_transcoding gem, or something else?
Dyslexia cured for now. My only remaining question: Any idea why I have to use the absolute path to the gems (/opt/homebrew/Cellar/ruby/3.0.3/bin/gem install) rather than the designated path (gem install)? That works with either video_transcoding or other_video_transcoding. Thanks.
Thanks again. There are some things about oh-my-zsh that confused me, I think. Some things about Ruby Gems also. I think I've got it now, anyway. Hopefully another repository's supporters will get the invitation to guide me next time, you've performed your duties with great skill. Over and out.
Sorry if this is a duplicate request. I'm just so lost. Just when I thought everything was OK - M1 MacBook Pro shows "can't find gem video_transcoding". I thought I had migrated homebrew successfully, but ruby must be more complicated, or I'm just not able to solve the problem.
$which transcode-video /usr/local/bin/transcode-video
$/opt/homebrew/bin/transcode-video zsh: no such file or directory: /opt/homebrew/bin/transcode-video
$/usr/local/bin/transcode-video /Library/Ruby/Site/2.6.0/rubygems.rb:265:in'
find_spec_for_exe': can't find gem video_transcoding (>= 0.a) with executable transcode-video (Gem::GemNotFoundException) from /Library/Ruby/Site/2.6.0/rubygems.rb:284:in
activate_bin_path' from /usr/local/bin/transcode-video:23:in `Is there a simple fix I've missed? Any fix I've missed?
Thanks.