I am using macOS 11.5.1 Big Sur and I tried to install Graphviz via
brew install graphviz
but I got an error:
Error: python#3.9: wrong number of arguments (given 1, expected 0)
The version of my Homebrew is
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 7ff3c752de; last commit 2021-08-13)
Homebrew/homebrew-cask (git revision af069ca1b1; last commit 2021-08-13)
I have no idea about the reason. Any suggestions? Thank you.
I have fixed this issue, by the following commands.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app
Then rerun the brew install:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
It works on my Mac. Just share in case that anyone encounters the same issue.
I was unable to get it to work with homebrew. I read other threads recommending trying with Ports, which I did and failed also, since I got a little farther with Ports, I continue to look and finally found this...
Uninstall graphiz if you tried homebrew: brew uninstall graphviz
Install Ports https://www.macports.org/install.php
edit the Ports installation https://www.macports.org/install.php
Edit opt/etc/macports/sources.conf, comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
Run sync in debug mode and watch for the tarball being used instead of rsync:
sudo port -d sync
sudo port install graphviz
I'm running the install with an admin account I tried
sudo gem install cocoapods
and
sudo gem install cocoapods -n /usr/local/bin
They both run fine with following output
Fetching cocoapods-1.9.1.gem
Successfully installed cocoapods-1.9.1
Parsing documentation for cocoapods-1.9.1
Installing ri documentation for cocoapods-1.9.1
Done installing documentation for cocoapods after 2 seconds
1 gem installed
however, a simple
pod --version
Returns
zsh: command not found: pod
I'm not too good at managing users accounts or dealing with command shell but I scoured the net and couldn't find a solution. It looks like wherever pod is installed, it doesn't make it to the list of executable applications
The issue was that command line for XCODE was not installed.
First I updated to latest Ruby version and put the version number in the second command (in place of [version]
curl -L https://get.rvm.io | bash -s stable
rvm install ruby-[version]
During the install you will see the Software update available from MAcOS popup. Install immediately and continue with prompts in that window (I believe it asks for updates and then asks for install.
It will take a while to run / download / install (it took 2 expressos for me :) )
After that I ran
sudo gem install cocoapods
And restarted my terminal.
Now checking it's installed
pod --version
Returns the installed version (1.9.1 for me)
I followed these instructions but ended up with the same issue. So I ran gem list | grep cocoapods and then uninstalled every instance of cocoapods with gem uninstall cocoapods along with the executables. Then I decided to install cocoapods using Homebrew with brew install cocoapods, restarted my Mac and the pod command was available. Remember I didn't restart my Mac after using sudo gem install cocoapods,maybe that will work too, you can try.
I am trying to use Cocoapods, but I'm stuck with even setting it up properly. It keeps showing me
-bash: pod: command not found
and I can't do anything. Also, the
$ pod init
doesn't work. I suppose the my computer cannot find any commands related to Cocoapods.
I've followed all the ways that was listed on the Cocoapods website, and read from websites such as raywenderlich but nothing helped.
$ sudo gem install cocoapods
Successfully installed cocoapods-1.7.5
Parsing documentation for cocoapods-1.7.5
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod setup --verbose
-bash: pod: command not found
I expect it to clone the CocoaPods Master Specs repository into ~/.cocoapods/ on my computer. Please help.
I actually thought you'd get the "You don't have write permissions for the /usr/bin directory." error, but your successfully installing it. I'm not sure why it's installing it in and then reading from another.
Try installing in a different directory:
sudo gem install -n /usr/local/bin cocoapods
For more see here
Recently I tried to do pod setup and I get this error:
-bash: /usr/local/bin/pod: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory
I followed Ray Wenderlich's guide to install CocoaPods and I get this issue so I have no idea what is going on.
I encountered this problem when upgrading to Mac OS High Sierra.
This was my fix:
sudo gem install cocoapods
I found this answer on the CocoaPods issue list on Github.
This happened when I upgraded to Catalina.
I solved it by running:
sudo gem install -n /usr/local/bin ruby
sudo gem install -n /usr/local/bin cocoapods
After upgraded to High Sierra, I got the same error, just reinstalled the cocoapods
sudo gem install -n /usr/local/bin cocoapods
Same issue I was facing when I updated our system from Sierra to Mojave. Also works for Catalina
The following steps worked:
sudo gem update --system
sudo gem install -n /usr/local/bin cocoapods
I got the help from the following link.
brew link --overwrite cocoapods
This line saved my day.
i fixed it by running brew install ruby
The following worked for me:
Select Command Line Tools in XCode.
XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
In terminal execute:
sudo gem install cocoapods -n /usr/local/bin
https://stackoverflow.com/a/60464653
While I'm trying to install again then I got another error saying that
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
Then I did this and worked fine.
sudo gem uninstall cocoapods
sudo gem install cocoapods
On my mac this solved the problem:
brew uninstall cocoapods
brew install cocoapods
After upgrading from OS X Mojave to OS X Catalina I received this message when running pod init or pod --version:
-bash: /Users/mangolassi/.gem/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
I don't like the idea of sudo gem install cocoapods so I have my .cocoapods folder in my user directory and I've modified my .bash_profile to point to it. The error I received was because the version 2.3 was hard coded in this file:
/Users/eric/.gem/bin/pod and Catalina came with 2.6.
It's possible that using sudo install would overwrite this file successfully, and probably does, but I wanted to keep my original setup.
I was able to to just modify the first shebang line of the file /Users/eric/.gem/bin/pod to have a path with 2.6 instead of 2.3 and it worked. The entire change was changing the '3' to a '6' in my chase as the version was still '2'.
for MACOS X Catalina
Tried most of the answers but none worked. If the above doesn't work try Opening Xcode preferences > Locations > selecting Command Line Tools to Xcode. Then install cocoapods
sudo gem install -n /usr/local/bin cocoapods
The error in the original post is due to an improperly configured Ruby environment. You should never use sudo to install gems, no matter how many times you see it as an accepted answer on Stack Overflow.
At a high level, setting up a proper Ruby development environment on a Mac involves six steps:
Install Homebrew (which also installs the prerequisite Apple command line tools)
Install a Ruby manager (such as chruby, rbenv, asdf, RVM) - most of these can be installed with Homebrew
Configure the Ruby manager by adding the appropriate lines to your shell file (~/.bash_profile or ~/.zshrc) - each manager will have instructions for doing this, and this is a typical step that people miss
Restart the terminal (or open a new tab) for the shell changes to take effect - another step that is often overlooked
Install a specific version of Ruby using the Ruby manager
Switch to that version of Ruby using the Ruby manager
My personal preference is chruby with ruby-install. For more details and a script that can automate this whole process, check out my answer here:
https://stackoverflow.com/a/54873916/928191
As the accepted answer mentions, you can also install Ruby with Homebrew, but you also need to make sure to set your PATH in your shell file. Instructions for this are in my answer linked above.
I came across a similar issue when I tried upgrading the cocoa pods version using:
brew upgrade cocoapods
To fix this, cocopaods had to be linked with xcodeproj using the command below:
brew link cocoapods
If the linking fails, then you should be able to link by overwriting the previously existing link as follows:
brew link --overwrite cocoapods
Fixed with
brew upgrade cocoapods
In my case nothing of the above worked. I had ruby 2.3.0 installed and I had to downgrade to 2.0.0:
gem update --system 2.0.0
The "rubyist approved" way of doing this is to install a ruby version manager (rbenv) and install cocoapods through that. Messing with sudo and your rubygems is going to lead to tears.
Find the pod file. Mine was located at usr/local/bin/pod
You'll find that the top line says version 2.3. Edit this file to the correct version number. Save a copy of the original incase you mess it up.
Try your pod related commands again.
Worked for me after days of trying everything.
vi pod
then replace the ruby path 2.3 one to the path which u get by using
which ruby command in terminal
then do pod setup it will work
this worked for me after trying all the listed solutions .
re-installing ruby solving issues on my case (error happen after I upgrade Mac OS to Monterey). it's take a bit of time to reinstall but it worked
I installed ruby via \curl -L https://get.rvm.io | bash -s stable and did rvm install 1.9.2 doing this creates and error
Installing requirements for osx, might require sudo password.
fatal: Unable to create '/usr/local/.git/index.lock': Permission denied
Error: Failure while executing: git checkout -q master
Failed to update Homebrew, follow instructions here:
https://github.com/mxcl/homebrew/wiki/Common-Issues and make sure `brew update` works before continuing.
Upon doing a which git it shows it's installed in /usr/bin/git yeah homebrew keeps trying to reference /usr/local/.git. I tried unistalling homebrew so I can do a fresh install using what's listed at homebrew gist. All seemed well but doing a which brew still shows it as /usr/local/bin/brew so I tried to manually uninstall it by doing it one by one.
One thing to note is I never had a Cellar folder, why I don't know. While doing a brew prune I noticed a lot of macport items are starting to ask if I should override them.
Is it typical to of ran the uninstall script but still have the brew commands available or the dirs?
Why is it that homebrew needs root access to /user/local/ to work, this is extremely bad.
That /usr/local/.git it's referencing is not the git executable, but the config file for the repository it's trying to set up under /usr/local/. It's trying to write to that file.
To run homebrew you need write permissions to /usr/local as the user you'r going to run brew as. Homebrew's recommended method is to adjust the ownership and permissions on /usr/local to allow you to write to it from your regular user account or a dedicated homebrew account, instead of using sudo. This is done as part of the homebrew installation script, typically by putting you in the admin group and making /usr/local group-writable.
To fix this, check the owner and permissions on /usr/local/ and /usr/local/.git and make sure you can write to them (and the rest of the /usr/local/ hierarchy) as the user that you're running brew and RVM commands as.
Ended up just doing a sudo $USER as I really could not find any other approach to fixing this.