lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

nothing to update, but other-transcode fails to run. #158

Closed LwsBtlr closed 2 years ago

LwsBtlr commented 2 years ago

other-transcode worked the last time I used it, but today I am getting errors. I tried to updated and gem says it doesn’t need to update, but it fails to execute. Not sure where to go from here (I’m generally good with the CLI and brew, but my only use of ruby or gem is for this package).


 $ gem update other_video_transcoding
Updating installed gems
Nothing to update
 $ other-transcode --help
/opt/homebrew/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:265:in `find_spec_for_exe': can't find gem other_video_transcoding (>= 0.a) with executable other-transcode (Gem::GemNotFoundException)
        from /opt/homebrew/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:284:in `activate_bin_path'
        from /usr/local/bin/other-transcode:23:in `<main>’```
lisamelton commented 2 years ago

@LwsBtlr I'm sorry you're having this problem but it's clear there's an issue somewhere with your system $PATH variable and/or Ruby Gem configuration.

Have you recently upgraded your system or Ruby itself?

loshlee commented 2 years ago

It's that pesky Monterey plus ARM plus zsh leap. The latest ruby update may cause that. For me, other-transcode executable is now located in /opt/homebrew/lib/ruby/gems/3.1.0/bin/

See what you get when you run which other-transcode

What happens if you use that path to execute other-transcode?

If that works, then you should be able to add it to the path with by adding the following line to .zshrc in your home folder. export PATH=/opt/homebrew/lib/ruby/gems/3.1.0/bin:$PATH

You can see that file in Finder if you open your home folder then press command-shift-period.

You'll also need to remove the other-transcode executable nested in /usr/local.

There's sort of a process for moving from /usr/local/ to /opt/homebrew/ for all Homebrew-installed software. Until you do, things could be a little mixed up. I can help if needed, but there are definitely other users who can do it more deftly.

lisamelton commented 2 years ago

@loshlee Thanks for the comment! Hopefully that solves @LwsBtlr problem.

LwsBtlr commented 2 years ago

Hmm. I have a link /usr/local/bin/other-transcode -> /opt/homebrew/lib/ruby/gems/3.0.0/bin/other-transcode

If Iremove that link then other-transcode is not found because …./lib/… is not in $PATH. Having a variable path that I have to put into PATH is going to be annoying when there is a 3.1.1 or 3.2.0. Trying to execute the full bath results in a different error though.


 $ /opt/homebrew/lib/ruby/gems/3.0.0/bin/other-transcode --help
/opt/homebrew/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:265:in `find_spec_for_exe': can't find gem other_video_transcoding (>= 0.a) with executable other-transcode (Gem::GemNotFoundException)
        from /opt/homebrew/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:284:in `activate_bin_path'
        from /opt/homebrew/lib/ruby/gems/3.0.0/bin/other-transcode:23:in `<main>’```
lisamelton commented 2 years ago

@LwsBtlr Yes, on macOS you have to change $PATH for every major upgrade to Ruby and RubyGems. Sometimes for minor upgrades. That's just the way Unix works.

LwsBtlr commented 2 years ago

On my Freebsd system there are 947 executable binaries in .usr.local.bin and /usr/local/sbin which is normal or unix. I don’t have to run postfix out of …/mail/postfix/3.7.0_2/bin/postfx and change that path every time I update postfix, so this behavior is very weird to me and seem to be unique to ruby gems, no?

But either way, the other-transcode executable at /opt/homebrew/lib/ruby/gems/3.0.0/bin/other-transcode fails to execute, and the gem update command says it doesn’t need updating, so I still don’t have a way to fix this.

lisamelton commented 2 years ago

@LwsBtlr It's not unique to Ruby Gems in the Unix world.

As for the problem, see if you can uninstall the other_video_transcoding Gem first.

loshlee commented 2 years ago

I would try "gem uninstall other-transcode", affirming the removal of ancillaries when prompted, followed by "gem install other-transcode". However, there could be old stragglers nested in /usr/local that are interfering. Best to migrate everything that can be built under ARM (64, 65, whatever it takes - adapted from Mr. Mom - 1983 - MGM :) ) into /opt/homebrew. Here are some things to look at.

https://stackoverflow.com/questions/15872666/how-to-remove-entry-from-path-on-mac https://apple.stackexchange.com/questions/410825/apple-silicon-port-all-homebrew-packages-under-usr-local-opt-to-opt-homebrew

LwsBtlr commented 2 years ago

Yeah, I just did gem uninstall other-transcode and it said it was not installed, despite previously saying it did not need to be updated. installing it leaves the old other_transcode in …./3.0.0/bin and installs a new one in …/3.1.0/bin/, so that’s real great since gem has left behind everything and also never updated it with a new ruby, so that’s pretty annoying go gem. Seems all sorted now, but this is a lot more fiddly and complicated that running /bind/Maria/aoache/dovecot/postfix/php combined.

Everything was migrated to ARM when I first got the M1 mini at release, which is why there is a /opt/homebrew/ hierarchy at all.

loshlee commented 2 years ago

BTW, here's something I picked up for simplifying #PATH issues.

You can create a function for displaying #PATH one per line:

Place a function such as this one in your .zshrc file, then "psed" (or whatever you want) in Terminal displays it.

function psed { echo "$PATH" | sed 's/:/\n/g' }

LwsBtlr commented 2 years ago

I do something similar, but with tr and I just type it in on the rare occasions it might be useful. echo $PATH | tr ':' '\n’

So many ways to skin all the cats in Unix 😃

loshlee commented 2 years ago

I like it, but that last single quote got curled. Doesn't it need to be echo $PATH | tr ':' '\n'?

LwsBtlr commented 2 years ago

the vagaries of typing on a Mac is sometimes, quotes get curled for no discernible reason. 🤷‍♀️