Can't run "pod install" in jenkins - macos

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.

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.

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

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.

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
/usr/local/bin/pod install
This worked for me

Related

git bash does not recognize "environment path" when using package.json scripts

I am trying to yarn start with git bash
"start": "node scripts/start.js",
It always works when using PowerShell or CMD.
But it does not work with git bash.
But when I tried to node scripts/start.js instead yarn start with bash it works!
I tested git bash
yarn -v, node -v, npm -v,
every command works well.
But not work with scripts...
This is the error message
'node' is not recognized as an internal or external command
And i tried to
"startStart": "yarn start",
And this time bash gives me this error message
'yarn ' is not recognized as an internal or external command
I checked my env PATH but all is fine.
--- ENV
VS_CODE
OS : window 10
node : 13.5
npm : 6.13.4
I installed git-bash with git
And all install config is default-standard
Add
I think Git-Bash can find the path when it is alone
I think we should focus on that it can't find path only when it try to trigger package.json scripts
About .profile I didn't know what it is and I never created it.
If it is not default - exist I don't have it.
without to relate to windows specific, npm executes scripts commands (specified in package.json) under the default shell, but it does not perform a login to the shell.
for instance, a bash login (bash --login) in order to use your custom system environment variable.
you can change this by using .npmrc file and set the script-shell. see this answer for the solution.
i hope this is what you suffer from :)

how to get automator app to run a yarn command

I'm setting up an automator run shell script to go to a specific folder on users machines and then yarn run dev but when it gets to the yarn part it can't find yarn.
-line 1: yarn: command not found
If I use terminal then yarn will run fine.
I have yarn installed -g which is in my NVM modules.
Here is my script in automator.
cd ~/Documents/myProject
yarn run dev
Also tired this setup:
Like this:
export PATH=$PATH:/Users/me/.nvm/versions/node/v10.16.3/bin
cd ~/Documents/myProject
yarn run dev
The first line tells bash where to look for programs, such as yarn and node.

docker commands not found

I installed docker in Mac and it is installed successfully.
Also it is running.
And tried to execute the below command in terminal
docker -v
See the below error:
-bash: docker: command not found
How do I solve this issue.
In windows those commands are working fine.
If you successfully installed docker using the official package, the command should be available under /usr/local/bin/docker.
That directory might not yet be in your $PATH, so you could try adding export PATH="/usr/local/bin:$PATH" to your .bashrc / .bash_profile.

Installing Glassfish, Wildfly using homebrew on Mac OSX

Trying to install Glassfish(Java EE App. Server) and Wildfly App Server using Homebrew .
http://macappstore.org/wildfly-as/
http://macappstore.org/glassfish/
used these above mentioned tutorials .
I got the following errors while trying to run them by typing just "glassfish" & "wildfly-as" respectively.
Output(Error):
-bash: glassfish: command not found
-bash: wildfly-as: command not found
Searched about it and I think it has something to do with $PATH. I don't understand $PATH Variable . Need help.
The issue is that there are two asadmin scripts. One at $GLASSFISH_HOME/bin and one at $GLASSFISH_HOME/glassfish/bin
Here are full instructions to get your domain up
brew update
brew install glassfish
you should see message, add that line to your .bash_profile
==> Caveats
You may want to add the following to your .bash_profile:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec
Open a new terminal then, cd $GLASSFISH_HOME/glassfish/bin
./asadmin start-domain --verbose
Browse to http://localhost:8080 for welcome page and http://localhost:4848 for admin console
I actually installed Wildfly-Application Server using homebrew but could not find a way to run it.
https://tomylab.wordpress.com/2016/07/03/how-to-install-wildfly-on-mac/
This tutorial helped me .
And for glassfish, my installation was again successful using homebrew but was not able to run it . I did figure it out when I ran the following commands.
$ cd /usr/local/opt/glassfish/libexec/bin
$ ./asadmin
asadmin> start-domain
You need to understand about the PATH variable. It is an environment variable on Unix-like operating systems, specifying a set of directories in which executable programs are located. In general, each executing process, or user session, has its own PATH setting.
So, you need to add the glassfish home path to your actual path variable.
Now, as per your problem with running the Glassfish server; try this:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec/
export PATH=$PATH:$GLASSFISH_HOME/bin
Add it to your bash profile, if you do not want to do this everytime.

pod install: command not found when called from bash script

I'm improving the continuos integration of a project. And we decided to take an extra step and start using cocoapods. All the rvm installation is legacy and indeed I have a lot of troubles installing ruby 2.2.0. The thing is that, when I test my build script using terminal it works fine, but when I try to run them without opening a terminal window (called from applescript, jenkins or another ruby script). The command is not found.
Already tried adding the path to .rvm/scripts to the PATH variable in both .bashrc and .bash_profile
Have you try to reconnect the server after you installed the cocoapods? sometimes it doesn't see the new vars till it disconnected and reconnected.
Also make suer that the vars that you see through the terminal are available for jenkins user. you can check that through the slave "Script Console"
If it still don't work, try to set the path in the "execute shell", just before you run the pod install.
This is how it works for me:
echo "Running pod install"
cd ${WORKSPACE}
export LANG=en_US.UTF-8
pod install

Resources