cocoapods-art icon indicating copy to clipboard operation
cocoapods-art copied to clipboard

Support installing using brew

Open LeonidKokhnovich opened this issue 2 years ago • 11 comments

With the M1 Apple Silicon, you have to use brew for installing cocoapods for native installation. Due to that, installing cocoapods-art module using gem wouldn't be recognized by the cocoapods version installed through brew. It would be great to have a way to install cocoapods-art using brew to address the issue, what does everyone think about that?

LeonidKokhnovich avatar Apr 13 '22 21:04 LeonidKokhnovich

I have the same issue with my M1! When I run "sudo gem install cocoapods-art", it said that was successfully installed. But when I run "pod install", I get this error: "Podfile requires that the plugin cocoapods-art be installed".

rubenbacanu avatar Aug 04 '22 13:08 rubenbacanu

Any update on this? Cannot use cocoapods-art on Apple chips and it is a major blocker for us.

nadishan avatar Aug 13 '22 21:08 nadishan

Same issue here...

aca-hakan-pinar avatar Aug 24 '22 09:08 aca-hakan-pinar

I had the same issue but I found a way to get it working. For this to work I have assumed you have already installed cocoapods via brew.

The following script will copy over the required files from the global Ruby installation:

#!/bin/zsh

RUBY_ROOT="/Library/Ruby/Gems/2.6.0"
COCOA_ROOT="/opt/homebrew/Cellar/cocoapods/1.11.3/libexec"

cp -R "$RUBY_ROOT/gems/$1" "$COCOA_ROOT/gems/"
cp "$RUBY_ROOT/specifications/$1.gemspec" "$COCOA_ROOT/specifications/"
sudo chown -R $USER "$COCOA_ROOT/gems/$1"
sudo chown $USER "$COCOA_ROOT/specifications/$1.gemspec"

Now you can verify if you have done everything correctly by running pod repo-art. It will give you some errors but that's ok, we will fix them afterwards. If it says repo-art not found you have done something wrong. (Maybe some of the copy commands made an additional directory or something)

To fix the errors we need to edit the $COCOA_ROOT/specifications/$1.gemspec . It should contain these lines at the beginning:

$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cocoapods_art'

Comment them out by adding a # before each line.

#lib = File.expand_path('../lib', __FILE__)
#$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
#require 'cocoapods_art'

The other edit we have to do is to change the version number from CocoaPodsArt::VERSION to a static version number. For me the version of cocoapods-art was 1.1.0 so I replaced it with '1.1.0'.

Now the command pod repo-art should run without issues. Hope this helps, had to do a lot of digging to figure this out!

Brent-rb avatar Aug 25 '22 16:08 Brent-rb

Same issue here. Is there anyone solved the problem without modifying gem file)? Thank you.

emreond avatar Nov 01 '22 21:11 emreond

Cant install cocoapods-art too. On Mac with M1 your script gives error: chown: /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/specifications/.gemspec: No such file or directory

rendomnet avatar Apr 28 '23 13:04 rendomnet

Cant install cocoapods-art too. On Mac with M1 your script gives error: chown: /opt/homebrew/Cellar/cocoapods/1.11.3/libexec/specifications/.gemspec: No such file or directory

you must execute the script with an argument, in this case the name of the plugin -> Example: sh script-name.sh cocoapods-art-1.1.0

miguelolmedoP avatar May 11 '23 22:05 miguelolmedoP

I used the script without success

cp: /Library/Ruby/Gems/2.6.1/gems/cocoapods-art-1.1.0: No such file or directory
cp: /Library/Ruby/Gems/2.6.1/specifications/cocoapods-art-1.1.0.gemspec: No such file or directory
chown: /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-art-1.1.0: No such file or directory
chown: /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/specifications/cocoapods-art-1.1.0.gemspec: No such file or directory

the gem is not there so how can I copy it? I tired before

sudo gem install cocoapods-art

WeddMate-Apps avatar Jul 03 '23 15:07 WeddMate-Apps

You must have cocoapods and cocoapods art installed with the same method

So you can install cocoapods and cocoapods with brew ( change your Path with .zshrc file if you do that and verify command « which pod » return the good one)

fast way: Ruby and Gem are already installed on your system by default so you can install cocoapods and cocoapods-art with gem

killianTrm avatar Jul 15 '23 09:07 killianTrm

Hi @Brent-rb , I tried your solution but while executing cp "$RUBY_ROOT/specifications/$1.gemspec" "$COCOA_ROOT/specifications/" I am getting response like "cp: /Library/Ruby/Gems/2.6.0/specifications/.gemspec : No such file or directory" I have almost 40 files with the extension ".gemspec", could you please mention which file I have to copy or do I have to copy all the 40 files to the "$COCOA_ROOT/specifications/"?

sudo chown $USER "$COCOA_ROOT/specifications/$1.gemspec" chown: /opt/homebrew/Cellar/cocoapods/1.14.3/libexec/specifications/.gemspec: No such file or directory the above command also showing No such file or directory, do you have any alternative solution?

AkashSArjun avatar Nov 27 '23 11:11 AkashSArjun

Hi @Brent-rb , I tried your solution but while executing cp "$RUBY_ROOT/specifications/$1.gemspec" "$COCOA_ROOT/specifications/" I am getting response like "cp: /Library/Ruby/Gems/2.6.0/specifications/.gemspec : No such file or directory" I have almost 40 files with the extension ".gemspec", could you please mention which file I have to copy or do I have to copy all the 40 files to the "$COCOA_ROOT/specifications/"?

sudo chown $USER "$COCOA_ROOT/specifications/$1.gemspec" chown: /opt/homebrew/Cellar/cocoapods/1.14.3/libexec/specifications/.gemspec: No such file or directory the above command also showing No such file or directory, do you have any alternative solution?

Don’t follow this instructions you not must copy this files. it’s not necessary If the command “pod” don’t give you “pod repo-art”, your installation is not good

killianTrm avatar Nov 27 '23 11:11 killianTrm