Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installing using brew #59

Open
LeonidKokhnovich opened this issue Apr 13, 2022 · 11 comments
Open

Support installing using brew #59

LeonidKokhnovich opened this issue Apr 13, 2022 · 11 comments

Comments

@LeonidKokhnovich
Copy link

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?

@rubenbacanu
Copy link

rubenbacanu commented Aug 4, 2022

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".

@nadishan
Copy link

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

@aca-hakan-pinar
Copy link

Same issue here...

@Brent-rb
Copy link

Brent-rb commented Aug 25, 2022

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!

@emreond
Copy link

emreond commented Nov 1, 2022

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

@rendomnet
Copy link

rendomnet commented Apr 28, 2023

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

@miguelolmedoP
Copy link

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

@WeddMate-Apps
Copy link

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

@killianTrm
Copy link

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

@AkashSArjun
Copy link

AkashSArjun commented Nov 27, 2023

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?

@killianTrm
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests