CocoaPods gem can't be used

Created on 14 Sep 2016  路  3Comments  路  Source: CocoaPods/CocoaPods

What did you do?

Run pod --version

What did you expect to happen?

At least see CocoaPods version

What happened instead?

$ pod --version
/Users/k06a/.rvm/gems/ruby-2.2.5/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:23:in `source': uninitialized constant Gem::Source (NameError)
    from /Users/k06a/.rvm/gems/ruby-2.2.5/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:65:in `extension_dir'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1782:in `gem_build_complete_path'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1996:in `missing_extensions?'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb:131:in `missing_extensions?'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:66:in `contains_requirable_file?'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:64:in `block in require'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:63:in `each'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:63:in `find'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:63:in `require'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/source.rb:1:in `<top (required)>'
    from /Users/k06a/.rvm/gems/ruby-2.2.5/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:23:in `source'
    from /Users/k06a/.rvm/gems/ruby-2.2.5/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:35:in `full_gem_path'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1370:in `add_self_to_load_path'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1283:in `activate'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1314:in `block in activate_dependencies'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `each'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `activate_dependencies'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1282:in `activate'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1314:in `block in activate_dependencies'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `each'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `activate_dependencies'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1282:in `activate'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
    from /Users/k06a/.rvm/rubies/ruby-2.2.5/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
    from /Users/k06a/.rvm/gems/ruby-2.2.5/bin/pod:22:in `<main>'
    from /Users/k06a/.rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
    from /Users/k06a/.rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'

CocoaPods Environment

pod env gives the same error.

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

$ ruby --version
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin15]

$ gem --version
2.4.8

$ rvm list

rvm rubies

=* ruby-2.2.5 [ x86_64 ]
   ruby-2.3.0 [ x86_64 ]

Project that demonstrates the issue

This does not helps:

$ gem uninstall cocoapods
Remove executables:
    pod, sandbox-pod

in addition to the gem? [Yn]  y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.0.1
$ gem install cocoapods
Fetching: cocoapods-1.0.1.gem (100%)
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
Installing ri documentation for cocoapods-1.0.1
Done installing documentation for cocoapods after 2 seconds
1 gem installed

Most helpful comment

@k06a For what it's worth, I had the same issue this morning and fixed it by running gem update bundler.

All 3 comments

Looks like there's some problem with your Ruby installation, as it is the bundler gem breaking, not CocoaPods. The easiest way out is probably using http://cocoapods.org/app instead, because I'm not sure which steps to take to fix the exact issue you're having with your installation.

@k06a For what it's worth, I had the same issue this morning and fixed it by running gem update bundler.

@gregawoods thanks for suggestion, gem update bundler not works for me, but this one works fine:

$ gem uninstall bundler

Select gem to uninstall:
 1. bundler-1.12.5
 2. bundler-1.13.1
 3. All versions
> 2
Successfully uninstalled bundler-1.13.1
Was this page helpful?
0 / 5 - 0 ratings

Related issues

pallaviMN picture pallaviMN  路  3Comments

sonu5 picture sonu5  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

Bluelich picture Bluelich  路  3Comments

intelliot picture intelliot  路  3Comments