Cocoapods: please add the option to run as root

Created on 23 Jun 2019  路  18Comments  路  Source: CocoaPods/CocoaPods

I only know of cocoapods because some cordova plugin decided to integrate your library. so what happens is I build the whole Ionic project, the said cordova plugin compiles and then it all fails because you guys decided running sudo is unsafe.

ok, well the problem is npm, ionic and cordova, all three involved in the build process, disagree because all of them require privileges in order to compile correctly so after 3 crashes or so i decided to chown/chmod my whole computer which defeats the purpose of the supposed safety provided by supressing root user.

Please do understand that many of us know what they're doing or don't even care about the safety of their computer.. (I am running my iOS builds on a VM, so yeah I really don't care) so please give us the option to get on with our day and don't be the bottleneck of the big picture.

Thanks.

easy help wanted enhancement discussion

Most helpful comment

Seems like adding a --allow-root option would be reasonable

All 18 comments

I do not quite understand the request here. Can you not invoke CocoaPods as root already?

@dnkoutso no, if Cocoapods is called like for example "pod install" with sudo or when the user who called the process is "root", it will fail with an error message.
And I would kindly like to have the option to "shoot myself in the foot" if I want to :)

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

lame but ok

This "security feature" no longer makes sense in a Dockerized world. Moreover, it doesn't play nice with other CI tools which occasionally require root access.

Seems like adding a --allow-root option would be reasonable

it would also make it easier for people like me who use parent processes that call cocoapods to globally set --allow-root

馃憤 PRs welcome!

@amorde won't come from me, I don't code Ruby :D

I didn't either until working on CocoaPods :)

I'll mark as a starter ticket if someone new wants to give it a shot, I'm not personally planning on working on this in the near future.

Still open to contributions on this - the code that controls this error message is here:

https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/command.rb#L47

A good place to add the argument is here:

https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/command.rb#L42

Tests for this live here:

https://github.com/CocoaPods/CocoaPods/blob/master/spec/unit/command_spec.rb

This is feature still not released.
gem install cocoapods --pre

hello everyone... i have same issue,
i have ionic project when i run build command, its always ended with some errors that you can't run pod as root.
please help how can we disable this

As mentioned above, the option to allow running as root has been merged but isn't released yet. You can install the beta with --pre if you'd like to use it

thanks for responding,
can you tell me exact command to execute to install beta?

gem install cocoapods --pre

Was this page helpful?
0 / 5 - 0 ratings

Related issues

intelliot picture intelliot  路  3Comments

tlandsmancars picture tlandsmancars  路  3Comments

marzapower picture marzapower  路  3Comments

lzwjava picture lzwjava  路  3Comments

k06a picture k06a  路  3Comments