lisamelton / video_transcoding

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

Problems since upgrading to High Sierra #185

Closed Elucubrator closed 6 years ago

Elucubrator commented 6 years ago

Hi. I'm a complete noob when it comes to unix. I know enough to open the terminal and copy and past commands, but beyond that, I really don't understand all this.

I had the video transcode scripts working fine until earlier this week when I upgraded to Mac OS High Sierra.

Now, I consistently get the error message

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

I've tried uninstalling and re-installing home-brew and ruby, as well as the transcode-video files. As best I can see, everything is installed correctly, but I still get this error. Despite much googling and tweaking, I cannot fix this.

What is the cause, and is there a solution?

lisamelton commented 6 years ago

@Elucubrator I'm sorry you're seeing this problem. It appears that even though you uninstalled Homebrew and then reinstalled, which is the correct thing to do on a major macOS upgrade, you still have a problem with your Ruby installation.

Perhaps there was a Ruby upgrade after you re-installed Homebrew? If so, you'll have to uninstall Ruby again via Homebrew and then manually remove your existing Ruby Gems. Then you can safely reinstall Ruby and your Gems, i.e. video_transcoding. But first, let's find out if that's what happened.

Can you execute the following commands in Terminal.app and paste the output here?

First, let's verify where your Ruby is located:

which ruby

Next, let's examine your Ruby version:

ruby --version

Next, we do a similar series with the Gem tool itself:

which gem

... and:

gem --version

And now we dive even deeper with Gem:

gem list

And finally:

gem environment

Once I understand your configuration better, I can prescribe the proper solution.

Elucubrator commented 6 years ago

Thanks Don. I'm impressed with the amount of your time you make available to folks like me, and grateful for your help!

My ruby install is /usr/local/bin/ruby and the version is ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin17]

My gem tool is /usr/local/bin/gem and the version is 2.6.14.

gem list returns:

*** LOCAL GEMS ***

bigdecimal (1.3.4, default: 1.3.0)
did_you_mean (1.1.0)
io-console (default: 0.4.6)
json (2.1.0, default: 2.0.4)
minitest (5.11.1, 5.10.1)
net-telnet (0.1.1)
openssl (2.1.0, default: 2.0.5)
power_assert (1.1.1, 0.4.1)
psych (3.0.2, default: 2.2.2)
rake (12.3.0, 12.0.0)
rdoc (6.0.1, default: 5.0.0)
test-unit (3.2.7, 3.2.3)
video_transcoding (0.18.0)
xmlrpc (0.3.0, 0.2.1)

gem environment returns

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.14
  - RUBY VERSION: 2.4.3 (2017-12-14 patchlevel 205) [x86_64-darwin17]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.4.0
  - USER INSTALLATION DIRECTORY: /Users/KyleMcD/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/KyleMcD/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.4.3_1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-17
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.4.0
     - /Users/KyleMcD/.gem/ruby/2.4.0
     - /usr/local/Cellar/ruby/2.4.3_1/lib/ruby/gems/2.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/git/bin
lisamelton commented 6 years ago

@Elucubrator No problem! And sorry I took so long to respond this time, I was having surgery.

Thanks for all the information! And nicely formatted, too. But... dang. You configuration looks identical to mine. You don't seem to have the problem with your Gem configuration not matching your Ruby installation.

So I have no idea what could be wrong. :(

You didn't use sudo to install the video_transcoding Gem, did you?

Also, what happens if you try to execute transcode-video using a full path? That is, like this:

/usr/local/bin/transcode-video

And, if that doesn't work, what output do you get when you execute this?

file /usr/local/bin/transcode-video

Finally, what does the output of this command look like?

ls -alpR /usr/local/lib/ruby/gems/2.4.0/gems/video_transcoding-0.18.0

BTW, I might be temporarily unavailable this evening for awhile due to recovery. But I have my MacBook with me so I'll try to respond as soon as I can.

Elucubrator commented 6 years ago

I think I did have to use the sudo command to install.

From memory, I was getting an error message don't have write permissions for the /usr/local/bin directory.

Some search results I found suggested the Systems Integrity Protection was the culprit, but I have not found any difference with it on or off. (I have it active at the moment.)

When I use the full path, I still get the error No such file or directory @ rb_file_s_stat

The result from file /usr/local/bin/transcode-video is a /usr/local/opt/ruby/bin/ruby -W script text executable, ASCII text

The output from the last command is

total 168
drwxr-xr-x   7 KyleMcD  admin    238  5 Jan 14:23 ./
drwxr-xr-x  21 KyleMcD  admin    714  5 Jan 14:23 ../
-rw-r--r--   1 KyleMcD  admin   1059  5 Jan 14:23 LICENSE
-rw-r--r--   1 KyleMcD  admin  77736  5 Jan 14:23 README.md
drwxr-xr-x   6 KyleMcD  admin    204  5 Jan 14:23 bin/
drwxr-xr-x   4 KyleMcD  admin    136  5 Jan 14:23 lib/
-rw-r--r--   1 KyleMcD  admin    970  5 Jan 14:23 video_transcoding.gemspec

/usr/local/lib/ruby/gems/2.4.0/gems/video_transcoding-0.18.0/bin:
total 152
drwxr-xr-x  6 KyleMcD  admin    204  5 Jan 14:23 ./
drwxr-xr-x  7 KyleMcD  admin    238  5 Jan 14:23 ../
-rwxr-xr-x  1 KyleMcD  admin  11953  5 Jan 14:23 convert-video
-rwxr-xr-x  1 KyleMcD  admin   4215  5 Jan 14:23 detect-crop
-rwxr-xr-x  1 KyleMcD  admin   7335  5 Jan 14:23 query-handbrake-log
-rwxr-xr-x  1 KyleMcD  admin  47269  5 Jan 14:23 transcode-video

/usr/local/lib/ruby/gems/2.4.0/gems/video_transcoding-0.18.0/lib:
total 8
drwxr-xr-x   4 KyleMcD  admin  136  5 Jan 14:23 ./
drwxr-xr-x   7 KyleMcD  admin  238  5 Jan 14:23 ../
drwxr-xr-x  14 KyleMcD  admin  476  5 Jan 14:23 video_transcoding/
-rw-r--r--   1 KyleMcD  admin  501  5 Jan 14:23 video_transcoding.rb

/usr/local/lib/ruby/gems/2.4.0/gems/video_transcoding-0.18.0/lib/video_transcoding:
total 112
drwxr-xr-x  14 KyleMcD  admin    476  5 Jan 14:23 ./
drwxr-xr-x   4 KyleMcD  admin    136  5 Jan 14:23 ../
-rw-r--r--   1 KyleMcD  admin   1244  5 Jan 14:23 cli.rb
-rw-r--r--   1 KyleMcD  admin    901  5 Jan 14:23 console.rb
-rw-r--r--   1 KyleMcD  admin    138  5 Jan 14:23 copyright.rb
-rw-r--r--   1 KyleMcD  admin   3343  5 Jan 14:23 crop.rb
-rw-r--r--   1 KyleMcD  admin    124  5 Jan 14:23 errors.rb
-rw-r--r--   1 KyleMcD  admin    822  5 Jan 14:23 ffmpeg.rb
-rw-r--r--   1 KyleMcD  admin   2360  5 Jan 14:23 handbrake.rb
-rw-r--r--   1 KyleMcD  admin  11741  5 Jan 14:23 media.rb
-rw-r--r--   1 KyleMcD  admin    776  5 Jan 14:23 mkvpropedit.rb
-rw-r--r--   1 KyleMcD  admin    578  5 Jan 14:23 mp4track.rb
-rw-r--r--   1 KyleMcD  admin   1300  5 Jan 14:23 tool.rb
-rw-r--r--   1 KyleMcD  admin    106  5 Jan 14:23 version.rb

At one stage when trying to update stuff, before doing a complete uninstall and re-install, I was getting error messages about not having write access to usr/bin. I can view that folder using the 'show system files' option in TotalFinder, the Finder replacement I'm using. It was when I discovered that I couldn't change the read-only settings for that folder, that my searches took me to suggestions about SIP being the culprit. I'm not sure if permissions have anything to do with my problems.

lisamelton commented 6 years ago

@Elucubrator My apologies again for taking so long to respond. Once the anesthesia wore off from my surgery, it was harder to deal with the pain than I thought. But I'm much better now. Pro tip: don't ever get sick. :)

OK, if you installed my video_transcoding Gem using sudo then that might be explain your problem. However, the output for that last diagnostic shows that the installed Gem has the correct user, group and permissions.

But what worries me is when you wrote that you had to install via sudo. If that's the case, there is something wildly wrong with the permissions on your machine because a proper Homebrew installation only requires sudo once, and that's only if your /usr/local directory is not configured correctly. Homebrew should never require sudo when executing brew install commands and with the version of Ruby that you install using it, Gem should never require sudo when executing gem install commands either.

Also, if you're getting error messages about usr/bin then something is very wrong. Did you mean to type usr/local/bin there? You should never install anything into /usr/bin.

I've never heard of TotalFinder. But I do suspect that permissions is at the core of your problem. Whether that's due to SIP or not, I don't know. Worse, I'm now at a loss on how to diagnose the problem for you to even suggest a solution. :(

Honestly, I'm stumped at this point.

Can you execute any other Gems you've installed?

lisamelton commented 6 years ago

@Elucubrator Were you able to resolve this issue yet?

And to repeat my last question, can you execute any other Gems you've installed?

andrewwickliffe commented 6 years ago

Hi Don!

Guess what... I'm having something similar. That I just discovered because I haven't been using my High Sierra Mac(book air) for transcoding lately.

Error:

andrewwickliffe@Minya /u/l/bin> /usr/local/bin/transcode-video 
Traceback (most recent call last):
    2: from /usr/local/bin/transcode-video:23:in `<main>'
    1: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems.rb:278:in `activate_bin_path'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem video_transcoding (>= 0.a) (Gem::GemNotFoundException)

Here's all the above info you asked for (for the other person).

/usr/local/bin/ruby
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

/usr/local/bin/gem
2.6.3

BUT then... I discovered no video_transcoding on my installed gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.4)
bundler (default: 1.16.0)
cmath (default: 1.0.0)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
did_you_mean (1.2.0)
etc (default: 1.0.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
json (default: 2.1.0)
minitest (5.10.3)
net-telnet (0.1.1)
openssl (default: 2.1.0)
power_assert (1.1.1)
psych (default: 3.0.2)
rake (12.3.0)
rdoc (default: 6.0.1)
rubygems-update (2.6.3)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
test-unit (3.2.7)
webrick (default: 1.4.2)
xmlrpc (0.3.0)
zlib (default: 1.0.0)
RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.3
  - RUBY VERSION: 2.5.0 (2017-12-25 patchlevel 0) [x86_64-darwin17]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.5.0
  - USER INSTALLATION DIRECTORY: /Users/andrewwickliffe/.gem/ruby/2.5.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/andrewwickliffe/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.5.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-17
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.5.0
     - /Users/andrewwickliffe/.gem/ruby/2.5.0
     - /usr/local/Cellar/ruby/2.5.0/lib/ruby/gems/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/X11/bin

So I did gem install video_transcoding and got

ERROR:  While executing gem ... (ArgumentError)
    wrong number of arguments (given 1, expected 0)

I'm extremely confused. I know I've used this Mac for transcoding...

lisamelton commented 6 years ago

@andrewwickliffe So you can't even install the video_transcoding Gem?

Can you install any other Gems?

andrewwickliffe commented 6 years ago

Nope :(

lisamelton commented 6 years ago

@andrewwickliffe OK, there is something really wrong with your Homebrew and Ruby installation. But I have no idea what it is. I suspect this may be related to the problem that @Elucubrator is having.

andrewwickliffe commented 6 years ago

wah! i'm wondering if its cakebrew. I've been running it regularly to remind me to update...

andrewwickliffe commented 6 years ago

(is this a ruby 2.5.0 thing I wonder)

lisamelton commented 6 years ago

@andrewwickliffe I doubt it's Ruby 2.5.0 because that works fine for me on Sierra. And since it's been out for almost a week I would have heard about that from other users on High Sierra. At least, I hope they would let me know.

I didn't know about Cakebrew but since it's just an app, I doubt it would cause this problem.

lisamelton commented 6 years ago

@andrewwickliffe Sorry, I sent that last comment to @Elucubrator instead of you.

lisamelton commented 6 years ago

@andrewwickliffe I just checked and it looks like you're using an old version of gem. Maybe that's the problem?

I have Ruby 2.5.0 and gem --version returns 2.7.4 for me. So you're significantly out of date there.

lisamelton commented 6 years ago

@andrewwickliffe BTW, did you remove your Homebrew installation and all of your Gems when you upgraded to High Sierra? If not, you should do that now and re-install everything.

Unfortunately, Homebrew isn't always stable after major macOS upgrades.

andrewwickliffe commented 6 years ago

thanks don!

no... no I did not reinstall after the upgrade. I shall do that.

andrewwickliffe commented 6 years ago

I had to manually update Rubygems (https://rubygems.org/pages/download) with sudo

and then reinstall video_transcoding

but I appear to be working now

lisamelton commented 6 years ago

@andrewwickliffe I'm glad it's working now but there should never be any reason to use sudo to update the Rubygems in your Homebrew installation. It's very possible what you did was update the Rubygems built into macOS itself. And I don't know what the implications of doing that are.

andrewwickliffe commented 6 years ago

(Now very glad I keep this computer lean)

On Jan 7, 2018, 10:24 PM -0700, Don Melton notifications@github.com, wrote:

@andrewwickliffe I'm glad it's working now but there should never be any reason to use sudo to update the Rubygems in your Homebrew installation. It's very possible what you did was update the Rubygems built into macOS itself. And I don't know what the implications of doing that are. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Elucubrator commented 6 years ago

Well, I had a look at the files in my sytem, and then a bit more of a think about what the error message I'm receiving might mean.

One your questions Don made think of trying something different. When you asked if I could run any of the other gems, I thought, "Well, the transcode-video --help command works just fine, so that alone suggests things are installed and working. But why am I getting the message No such file or directory @ rb_file_s_stat ?"

Thus far I've been selecting the external drive where I house my movies, then using the general command transcode-video "/path/to/Movie.mkv" In my case, I change to the external drive, named miniStack 2012, and then use the command transcode-video "/Movies/Movie Title.mkv"

On a hunch, I went into the Movies folder, and tried `transcode-video --mp4 "/Movie Title.mkv", and —voila! — it all worked.

I don't understand why I can get this working perfectly when in the Movies folder, but not otherwise. Curiouser and curiouser. But, it's working, and I can get by with that!

lisamelton commented 6 years ago

@Elucubrator At least it's working! :)

Is there anything else I can help you with or should we close this now?

Elucubrator commented 6 years ago

I think I'm good to go now Don. Thank you so very much for your help!

lisamelton commented 6 years ago

@Elucubrator You are very welcome!