0

I am getting this error while installing my react-native project -

/Users/username/.rvm/scripts/rvm: line 12: uname: command not found
/Users/username/.rvm/scripts/rvm: line 29: ps: command not found
/Users/username/Desktop/Applications/SegmentTestApp/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh:
line 27: readlink: command not found
/Users/username/Desktop/Applications/SegmentTestApp/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh:
line 27: dirname: command not found
/Users/username/Desktop/Applications/SegmentTestApp/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh:
line 27: cd: : No such file or directory Command PhaseScriptExecution
failed with a nonzero exit code

Here's my ~/.zshrc file -

export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

Environment -

❯ echo $PATH
/Users/<username>/.rvm/gems/ruby-3.0.0/bin:/Users/<username>/.rvm/gems/ruby-3.0.0@global/bin:/Users/<username>/.rvm/rubies/ruby3.0.0/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/<username>/Library/Android/sdk/emulator:/Users/<username>/Library/Android/sdk/tools:/Users/<username>/Library/Android/sdk/platform-tools:/Users/<username>/.rvm/bin
Dev AKS
  • 512
  • 1
  • 5
  • 17

1 Answers1

0

Solution #1

Below error message in logs tells that the command line tool is not able to understand uname or ps reference in RVM script.

/Users/username/.rvm/scripts/rvm: line 12: uname: command not found

I was curious about the whereabouts of uname so I did this -

> which uname
/usr/local/opt/coreutils/libexec/gnubin/uname

This path was already added in my .zshrc file as shown above in question, but it was still not solving the issue.

After opening the RVM script I came to know that it was not using zsh shell, instead it was using bash shell, so I added this path of uname in my .bash_profile file at the end -

export PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH

And it started working.

Solution #2

Other alternative solution can be to change the shell for rvm script to bash from zsh. Just change the first line of script

#!/usr/bin/<<shell name - bash/zsh>>
Dev AKS
  • 512
  • 1
  • 5
  • 17