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

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 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

@justvanbloom
Copy link

justvanbloom commented Sep 26, 2017

for all others:

gem install -n /usr/local/bin cocoapods

fixes it

@raisezhang
Copy link

raisezhang commented Sep 29, 2017

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

@anton-ogarkov
Copy link

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

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

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

@shaunbaker04
Copy link

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 :)

@uiuco
Copy link

uiuco commented Nov 16, 2017

(this help me)Try reinstalling:gem install cocoapods

@donpauldev
Copy link

Try this:

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

@shaunbaker04
Copy link

It's closed. Solved.

@wufei-limit
Copy link

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

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

@surya687
Copy link

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

@abhiveeru85
Copy link

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

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 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 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

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests