lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Error: /usr/local/bin/transcode-video: No such file or directory @ rb_file_s_stat - #299

Closed jameslmcdonald closed 5 years ago

jameslmcdonald commented 5 years ago

I keep getting this error message. I have uninstalled & reinstalled Homebrew & Video_Transcoding gem. Weird thing is I was transcoding videos yesterday with no issues. I did not make any changes to the computer. Below is the error message.

/usr/local/bin/transcode-video: No such file or directory @ rb_file_s_stat -
my-macbook-pro:~ jmcdonald$ "/Users/username/Movies/Modern Family, Season 1 Disc 1/Modern Family, Season 1 Disc 1_t00.mkv" -bash: /Users/username/Movies/Modern Family, Season 1 Disc 1/Modern Family, Season 1 Disc 1_t00.mkv: Permission denied

Any thoughts or suggestions I would appreciate it.

Thanks

lisamelton commented 5 years ago

@jameslmcdonald Sorry I took so long to respond. I missed the notification.

Unfortunately, there's not enough information here for me to diagnose the problem. Can you give me the full command line you were trying to execute and the error output? Perhaps that's what you were trying to do but the formatting is obscuring that? I can't tell.

Also, I need to know more about your environment. Can you execute the three following commands and paste in the output here?

ruby --version

which ruby

gem environment

Thanks.

jameslmcdonald commented 5 years ago

Command line: transcode-video --m4v --crop detect --fallback-crop handbrake \ --audio-width all=double --ac3-encoder eac3 --ac3-bitrate 384 \ --avbr --quick \ --burn-subtitle scan \ "/Users/jmcdonald/Movies/Modern Family, Season 1 Disc 1/Modern Family, Season 1 Disc 1_t00.mkv"

Error Message: /usr/local/bin/transcode-video: No such file or directory @ rb_file_s_stat -
zsh: no such file or directory: /Users/jmcdonald/Movies/Modern Family, Season 1 Disc 1/Modern Family, Season 1 Disc 1_t00.mkv

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

/usr/bin/ruby

RubyGems Environment:

Thanks for taking the time to look. Hopefully you see something, so I can get back to ripping my blu rays.

lisamelton commented 5 years ago

@jameslmcdonald Thanks! And sorry for taking so long to respond.

The problem is that you're using the default Ruby installation built into macOS. You need to install Ruby using Homebrew with brew installl ruby instead. And then reinstall the video_transcoding Gem.

lisamelton commented 5 years ago

@jameslmcdonald Did that fix the problem?

jameslmcdonald commented 5 years ago

Unfortunately it did not. I was still getting that same error message. Funny thing is it was working fine one day (I have done 300+ videos) and the next day the error message just started to appear. I got desperate and decided to do a fresh install of Mac OS. I wasn't able to finish setting up before work, so when I get home tonight I will finish it and hopefully it will work again.

Fingers crossed.

I will let you know if that worked or I get that dreaded error message again.

lisamelton commented 5 years ago

@jameslmcdonald Sorry that didn't work and that you had to go to such extreme measures. :(

Let me know how it goes. I'll see what I can do to help.

But it's clear looking at your current Ruby environment that you seem to have some broken hybrid install of Ruby itself. Here's what the output of gem environment should look like for you (more or less):

RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.6
  - RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x86_64-darwin18]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.6.0
  - USER INSTALLATION DIRECTORY: /Users/jmcdonald/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/2.6.0/bin
  - SPEC CACHE DIRECTORY: /Users/jmcdonald/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.6.5/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-18
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.6.0
     - /Users/jmcdonald/.gem/ruby/2.6.0
     - /usr/local/Cellar/ruby/2.6.5/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

Since /usr/local/opt/ruby/bin is not in your shell $PATH, you probably need to add this to the bottom of your ~/.bash_profile file:

PATH=/usr/local/opt/ruby/bin:$PATH

That might also fix the problem.

jameslmcdonald commented 5 years ago

Starting from scratch got me nowhere as I am still getting that same error. However, what I did notice was this.

brew install ruby Warning: ruby 2.6.5 is already installed and up-to-date To reinstall 2.6.5, run brew reinstall ruby

ruby --version ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

Reinstalling it does not fix the problem either. Any thoughts on why it won't recognize the newer version?

jameslmcdonald commented 5 years ago

Using RVM, I was able to get 2.6.5 as the default. However, I still get that same error. Any other suggestions?

jmcdonald@jmcdonalds-mbp ~ % transcode-video --m4v --crop detect --fallback-crop handbrake \ --audio-width all=double --ac3-encoder eac3 --ac3-bitrate 384 \ --avbr --quick \ --burn-subtitle scan \ "/Users/jmcdonald/Movies/Fast and Furious Presents- Hobbs and Shaw/Fast and Furious Presents- Hobbs and Shaw_t00.mkv" /Users/jmcdonald/.rvm/rubies/ruby-2.6.5/bin/transcode-video: No such file or directory @ rb_file_s_stat -
zsh: permission denied: /Users/jmcdonald/Movies/Fast and Furious Presents- Hobbs and Shaw/Fast and Furious Presents- Hobbs and Shaw_t00.mkv

ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]

/Users/jmcdonald/.rvm/rubies/ruby-2.6.5/bin/ruby

RubyGems Environment:

lisamelton commented 5 years ago

@jameslmcdonald I have no idea why brew install ruby is not working for you. :(

To be clear, this is a fresh install of macOS and a fresh install of Homebrew you're using?

BTW, using RVM is not recommended because it will often cause other problems.

jameslmcdonald commented 5 years ago

Yep fresh install of Mac OS Catalina and fresh install of homebrew.

I will remove RVM. Google led me there and I was getting desperate.

lisamelton commented 5 years ago

@jameslmcdonald OK, I've asked the members of my Video Transcoding Slack for help on this one. Hopefully one of them will see something I'm missing.

rhapsodians commented 5 years ago

Hi @jameslmcdonald ... just a thought: is the execute flag set for transcode-video? To check: cd /usr/local/bin ls -la transcode-video

You should see the execute flag x is set for the group/user/other permissions: -rwxr-xr-x 1 root admin 557 16 May 22:57 /usr/local/bin/transcode-video

If it looks like this (with no execute flag): -rw-r--r-- 1 root admin 557 16 May 22:57 transcode-video then you'll get a "No such file or directory" error on the command line when you try and execute transcode-video.

If it IS set to -rw-r--r--, then just sudo chmod 755 transcode-video and it will set the correct permissions

jameslmcdonald commented 5 years ago

I am work now, I will check it out when I get home.

Thanks!

lisamelton commented 5 years ago

@rhapsodians Thanks! That could very well be the problem.

jameslmcdonald commented 5 years ago

Well, that is not my issue as my permissions look like they should. Below is what I got.

-rwxr-xr-x 1 root admin 641 Nov 6 08:04 transcode-video

jameslmcdonald commented 5 years ago

I did finally get the latest version of ruby to stay. Here is what it says now.

ruby --version ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]

which ruby /usr/local/opt/ruby/bin/ruby gem environment RubyGems Environment:

lisamelton commented 5 years ago

@jameslmcdonald You should probably make sure /Users/jmcdonald/.rvm/bin is no longer in your $PATH.

jameslmcdonald commented 5 years ago

@donmelton Thanks for the tip. I removed it. Still getting the dreaded error. Any other thoughts or suggestions?

Thank you to everyone who has suggested things for me to try.

rhapsodians commented 5 years ago

Hi @jameslmcdonald ... I've just installed everything on a clean Catalina (10.15.1) and it all works fine so it will be an issue with your install somewhere.

So I'd like to suggest you completely uninstall all Homebrew items and then re-install. There's also an issue with Homebrew's HandBrakeCLI implementation so I'll walk you through the lot.

Uninstall Homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

Reboot Reboot your Mac

Install Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the various bits n pieces gem install video_transcoding brew install handbrake brew install ffmpeg brew install mkvtoolnix brew install mp4v2 brew install mpv

Download the HandBrakeCLI stuff from the web https://handbrake.fr/rotation.php?file=HandBrakeCLI-1.2.2.dmg

Replace the HBCLI brew content

I've then run your original command transcode-video --m4v --crop detect --fallback-crop handbrake --audio-width all=double --ac3-encoder eac3 --ac3-bitrate 384 --avbr --quick --burn-subtitle scan <path-and-movie>

and it works fine.

Hope this helps. Cheers, Joe

rhapsodians commented 5 years ago

@jameslmcdonald PS I'm using the default Catalina ruby (no installs from brew or anywhere else).


Discovery:~ joe$ which ruby
/usr/bin/ruby
Discovery:~ joe$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]```
rhapsodians commented 5 years ago

Alien3 (1992).m4v.log

rhapsodians commented 5 years ago

I ran this test against Alien3 with your command: transcode-video --m4v --crop detect --fallback-crop handbrake --audio-width all=double --ac3-encoder eac3 --ac3-bitrate 384 --avbr --quick --burn-subtitle scan "/Volumes/4TB/_Original Blurays/Alien3 (1992).mkv"

works fine as you can see above [PS I control-c-ed it about 2 min in as it was just a PoC]

jameslmcdonald commented 5 years ago

@rhapsodians this happens when I do gem install video_transcoding

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

However sudo gem install video_transcoding installs just fine.

rhapsodians commented 5 years ago

Sorry - I should have said you can also use sudo ... actually @donmelton mentions this in his installation guide.

jameslmcdonald commented 5 years ago

@rhapsodians Thank you so much! It is now working! I am so happy right now. Thank you @donmelton helping and putting up with me too.

lisamelton commented 5 years ago

@jameslmcdonald No problem! I think @rhapsodians did all the hard work here.

Should we close this now?

jameslmcdonald commented 5 years ago

Yes, go ahead and close.

Thanks again everyone.