lisamelton / video_transcoding

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

bad interpreter error after High Sierra update #173

Closed joethezombie closed 7 years ago

joethezombie commented 7 years ago

Since upgrading macOS to High Sierra, I can no longer use the video_transcoding tools. I get the error

-bash: /usr/local/bin/detect-crop: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Indeed, browsing to the Ruby versions reveals only 2.3. Anyway I can fix this? Sorry if this is an elementary question, I'm an end user and not really savy with Ruby.

lisamelton commented 7 years ago

@joethezombie Thanks for the detailed information! I always appreciate that because you made it easy to diagnose this problem.

Whenever you do a major OS upgrade on macOS, e.g. Sierra to High Sierra, you need to remove and reinstall Homebrew and your Ruby Gems. Otherwise you get Ruby runtime errors and other even more annoying problems like this. I know that sounds like "reinstall Windows" and a big pain, but it's really necessary.

joethezombie commented 7 years ago

Ah, thanks so much. That got it working again! Only other thing, I couldn't install video_transcoding normally due to write permissions.

Joes-iMac:~ joe$ sudo gem install video_transcoding
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

Instead, I had to:

Joes-iMac:~ joe$ sudo gem install -n /usr/local/bin video_transcoding
Successfully installed video_transcoding-0.17.4

Thanks so much for these great tools, and speedy support!

lisamelton commented 7 years ago

@joethezombie I'm glad that worked out! And you are very welcome, sir! I'll close this now but feel free to continue commenting here or you can open another issue.

goodydc commented 6 years ago

@donmelton I was a little late to the game with upgrading to High Sierra, but received the same error message as @joethezombie. I resolved my issue, and am good to go now, but thought I would share what I discovered while troubleshooting (before I found this thread :-/).

  1. High Sierra upgraded the ruby version from 2.0 to 2.3
  2. As noted in the error message, detect-crop was trying to use ruby 2.0, which no longer existed on my system
  3. gem install seems to insert #!/System/Library/Frameworks/Ruby.framework/Versions/X.X/usr/bin/ruby -W at the top of your scripts, where X.X is the specific version number of ruby that was present when the gem was initially installed
  4. The error message is generated because the old, fully-qualified path to ruby no longer exists
  5. Additionally, the RubyGems Environment installation directory changed from /Library/Ruby/Gems/2.0.0 to /Library/Ruby/Gems/2.3.0, so ruby wouldn't find the previously installed gem anyway. This is also why gem list no longer included video_transcoding as a local gem.

That's a long way of saying that your recommendation to reinstall the Ruby Gems after a major OS upgrade is the way to go. Perhaps you could add your recommendation to the FAQ, for future reference?

lisamelton commented 6 years ago

@goodydc Thanks for the information!

That's a good idea. However, it might be better for folks to install Ruby using Homebrew instead of relying on the version which ships with macOS. That's what I do. I may change the README to include both strategies.

goodydc commented 6 years ago

@donmelton Good call. I didn't install Ruby using Homebrew since Sierra already included a version that worked with your tools.

Thanks for all your hard work on these tools! :-)

lisamelton commented 6 years ago

@goodydc You are very welcome! And keep those useful comments coming.