Reputation: 3214
I'm trying to install Cocoapods version 0.35.0 with the following command:
sudo gem install cocoapods --version 0.35.0
When I try to verify the version with
pod --version
I get the following error:
---------------------------------------------
Error loading the plugin with path `/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/cocoapods_plugin.rb`.
NoMethodError - undefined method `tmpdir' for Dir:Class
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:66:in `<class:Try>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:8:in `<class:Command>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:5:in `<module:Pod>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/pod/command/try.rb:4:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-0.4.5/lib/cocoapods_plugin.rb:1:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:121:in `require'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:104:in `safe_require'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:32:in `block in load_plugins'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:31:in `each'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command/plugins_helper.rb:31:in `load_plugins'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:265:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
---------------------------------------------
0.35.0
I have tried to uninstall cocoapods and xcodeproj and install it again but it doesn't work. I had three other similar errors before but I got rid of them with
sudo gem update --system
Still, I can't fix the last error.
Upvotes: 2
Views: 1766
Reputation: 2384
Had the same problem. Cocoapods changed read access to cocoapods_plugin.rb. Try:
sudo chmod 644 /Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-0.6.0/lib/cocoapods_plugin.rb
Upvotes: 6
Reputation: 845
I ran into the same problem with ruby 2.1.2 but seems. ruby-2.2.2 works fine
Upvotes: 0
Reputation: 3214
I solved the problem by using RVM because I figured the error could have something to do with ruby versioning on my mac. I just installed it with
\curl -sSL https://get.rvm.io | bash -s stable --ruby
and then Cocoapods installed smoothly.
Upvotes: 5