Ruby gem shows "Invalid argument" error for almost every command

I'm working on setting up NativeScript on OS X El Capitan , and I'm stuck at the point where I should install xcodeprojand cocoapods. Almost everything I try to do with gemshows the same error:

$ sudo gem install xcodeproj
ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument

The following commands show the same error if I run it with sudoor not:

$ gem update --system
$ gem update
$ gem install whatever
$ gem install cocoapods

I have the following versions:

$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

$ gem --version
2.6.7

I tried some of the help I found on the Internet, including reinstalling gemand rubyrestarting, but nothing helped.

I assume I have a configuration problem with Ruby.

Any suggestions for troubleshooting?

+4
1

Homebrew.

, Ruby rbenv, cocoa pods.

:

  • ruby ​​

    brew uninstall ruby

  • rbenv ruby-build

    brew install rbenv ruby-build

  • Ruby .

    . Terminal - .

    eval "$(rbenv init -)" ~/.bash_profile

    .

    , rbenv init NAME_OF_YOUR_SHELL.

  • Ruby

    rbenv install 2.3.1

  • Ruby

    rbenv global 2.3.1

    rbenv local 2.3.1

  • Cocoapods

    gem install cocoapods

+11

Source: https://habr.com/ru/post/1656284/


All Articles