Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Sierra: bad interpreter #6898

Closed
Juice805 opened this issue Jul 25, 2017 · 18 comments
Closed

High Sierra: bad interpreter #6898

Juice805 opened this issue Jul 25, 2017 · 18 comments

Comments

@Juice805
Copy link

@Juice805 Juice805 commented Jul 25, 2017

Report

What did you do?

Run pod

What did you expect to happen?

run

What happened instead?

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

CocoaPods Environment

1.2.1

Similar to this report I am unable to use the pod command. However, unlike his report reinstalling does not fix the issue.

@Juice805
Copy link
Author

@Juice805 Juice805 commented Jul 25, 2017

Seemed to have fixed it. Some combination of rbenv, and sudo xcode-select --switch /Applications/Xcode-beta.app. It seems it was searching /Users/justin/Applications/Xcode.app originally and finding no CL Dev tools

@Juice805 Juice805 closed this Jul 25, 2017
@justvanbloom
Copy link

@justvanbloom justvanbloom commented Sep 26, 2017

for all others:

gem install -n /usr/local/bin cocoapods

fixes it

@raisezhang
Copy link

@raisezhang raisezhang commented Sep 29, 2017

sudo gem update --system
sudo gem install -n /usr/local/bin cocoapods
@anton-ogarkov
Copy link

@anton-ogarkov anton-ogarkov commented Oct 3, 2017

Actually if you are using Fastlane and have this issue with it, you can use the approach from @raisezhang . Just use fastlane instead of cocoapods in the last command.

@chuongtrh
Copy link

@chuongtrh chuongtrh commented Oct 9, 2017

Actually if you are using Fastlane and have this issue with it, you can use the approach from @raisezhang . Just use fastlane instead of cocoapods in the last command.

Try running ~/.fastlane/bin/fastlane env
@KrauseFx

@chanduiosdeveloper
Copy link

@chanduiosdeveloper chanduiosdeveloper commented Nov 10, 2017

After upgrading to macOS High Sierra, get it fixed with following commands:
sudo gem install cocoapods

@shaunbaker04
Copy link

@shaunbaker04 shaunbaker04 commented Nov 16, 2017

Just installed High Sierra and had the above listed problem and used: sudo gem install cocoapods
Worked perfectly and I'm back in business. Thanks guys :)

@wangdetong
Copy link

@wangdetong wangdetong commented Nov 16, 2017

(this help me)Try reinstalling:gem install cocoapods

@donpauldev
Copy link

@donpauldev donpauldev commented Nov 17, 2017

Try this:

sudo gem install -n /usr/local/bin cocoapods

@shaunbaker04
Copy link

@shaunbaker04 shaunbaker04 commented Nov 17, 2017

It's closed. Solved.

@jiaokang
Copy link

@jiaokang jiaokang commented Nov 22, 2017

When I run gem update --system under root. I get a error :

Updating rubygems-update
Fetching: rubygems-update-2.7.2.gem (100%)
Successfully installed rubygems-update-2.7.2
Parsing documentation for rubygems-update-2.7.2
Installing ri documentation for rubygems-update-2.7.2
Installing darkfish documentation for rubygems-update-2.7.2
Done installing documentation for rubygems-update after 46 seconds
Parsing documentation for rubygems-update-2.7.2
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.7.2
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem

Any suggestion?

@zirinisp
Copy link

@zirinisp zirinisp commented Nov 22, 2017

I got this issue with both cocoapods and fastlane. Using @raisezhang solution fixed both

@surya687
Copy link

@surya687 surya687 commented Dec 13, 2017

I too have the same problem as mentioned in the above post When I run gem update --system under root.

@abhiveeru85
Copy link

@abhiveeru85 abhiveeru85 commented Jan 9, 2018

I am having the same issue as mentioned by @jiaokang, gem update --system giving error under root.

@justvanbloom
Copy link

@justvanbloom justvanbloom commented Jan 9, 2018

Not as root. Exec as normal user.
See my first comment or here

gem install -n /usr/local/bin cocoapods

OS X does not allow in system due to system integrate protection. Shure you can turn it off but thats a bad idea. And /usr/local/bin is correct for now.

@dodikk
Copy link

@dodikk dodikk commented Feb 8, 2018

@jiaokang , I've faced the same issue. My workaround was installing cocoapods via homebrew. (Since all gem based instructions were failing for me).

brew install cocoapods
brew link --overwrite cocoapods

P.S. The second instruction has been suggested by homebrew

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/pod
Target /usr/local/bin/pod
already exists. You may want to remove it:
  rm '/usr/local/bin/pod'

To force the link and overwrite all conflicting files:
  brew link --overwrite cocoapods

To list all files that would be deleted:
  brew link --overwrite --dry-run cocoapods
@revolter
Copy link
Contributor

@revolter revolter commented Mar 3, 2018

And you have to pass -n /usr/local/bin for every gem you install? Because it solved this exact issue affecting another gem, not CocoaPods.

@samoclay
Copy link

@samoclay samoclay commented Jul 27, 2020

When i try this on Mac OS Catalina 10.15.5

rvm use 2.0.0                               
Using /Users/sam/.rvm/gems/ruby-2.0.0-p648
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).

I get

Exception `LoadError' at /Users/sam/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/rubygems.rb:1087 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/sam/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/rubygems.rb:1096 - cannot load such file -- rubygems/defaults/ruby
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
/Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- openssl (LoadError)
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/specification.rb:2481:in `to_ruby'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/commands/setup_command.rb:405:in `install_default_bundler_gem'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/commands/setup_command.rb:167:in `execute'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/command.rb:321:in `invoke_with_build_args'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/command_manager.rb:184:in `process_args'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/command_manager.rb:148:in `run'
	from /Users/sam/.rvm/src/rubygems-3.0.8/lib/rubygems/gem_runner.rb:59:in `run'
	from setup.rb:41:in `<main>'

Not really sure where I go from here as i've tried a few things:

$sudo gem update --system
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  Loading command: update (LoadError)
        cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

&

gem install -n /usr/local/bin cocoapods
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
ERROR:  Loading command: install (LoadError)
        cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.