Can't run “pod install” in jenkins

柔情痞子 提交于 2020-02-14 02:59:28

问题


My slave machine of Jenkins is Mac 10.8. Jenkins run job on my slave machine and run shell command of cocoapods below:

pod install 

and got error from console output of Jenkins job, please check below:

pod: command not found

I tried to run this command "pod install" in local's terminal of this slave machine and gets succeeds.

could you kindly help on me how to fix this problem?

Thanks.


回答1:


In my case, my ruby is installed by rvm. I need to load rvm in to find the pod command.

What I did is add this line #!/bin/bash -l in the beginning of the jenkins job.




回答2:


Ran into the same problem today, but neither of the solutions worked. What did work was changing the install command.

/usr/local/bin/pod install



回答3:


It seems the user with which Jenkins is running is not getting the path to the pod command that you are able to successfully execute from the Node's command shell. All you need to do is explicitly add the path in PATH variable in your Node's configuration page. To do this, Go to Jenkins > Manage Jenkins > Manage Nodes > Select the Node where your job is running > Click on Configure > Enable Node Properties. Refer the screenshot below:

Just add the path to your pod command in PATH variable. For ex., if the pod command is present in /usr/bin, then in the name field, enter PATH and in the value field, enter /usr/bin/:$PATH

I have not worked on Mac but hopefully, the above command should work there too. If it doesn't work, you can put the following line in $HOME/.bash_profile file of the user with which Jenkins is running: PATH=path_to_pod:$PATH

You can find the path to pod command by typing which pod on command line.



来源:https://stackoverflow.com/questions/25518916/cant-run-pod-install-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!