StuartM
StuartM

Reputation: 6823

Unable to run gem command: match init

I am trying to run a gem called match. https://codesigning.guide/

match init

When this runs the following is returned:

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

I have seen other related posts but those do not resolve my issue: CocoaPods not working in macOS High Sierra

It seems something somewhere is pointing toward Ruby 2.0, but that is not the current version in use.

ruby -v

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

rvm -v

rvm 1.27.0 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]

If I got to the path: /System/Library/Frameworks/Ruby.framework/Versions/ -- this has a folder 2.3 and Current.

I am not familiar with gems/ruby/rvm so unsure where to check.

Upvotes: 0

Views: 58

Answers (1)

Casper
Casper

Reputation: 34328

It looks like match is installed system-wide on your computer (perhaps done previously, before you installed RVM). The shell is picking it up from /usr/local/bin instead of from your RVM installation.

Not sure why the path of RVM is not before /usr/local/bin, but a quick fix is to rename the file match in /usr/local/bin to something else, and then try again:

sudo mv /usr/local/bin/match /usr/local/bin/match_old
hash -r

Now your shell should pick up match from your RVM installation instead (provided you've installed that gem under RVM).

Upvotes: 1

Related Questions