-bash: gcc: command not found - Mavericks - macos

I have installed
Xcode 5
Command line tools
gcc with homebrew
But when I try to use gcc command it says:
-bash: gcc: command not found
The location
gcc -version -bash: gcc: command not found
bolo:~ Michelin$ ls /usr/bin/gcc-4.2 /usr/bin/gcc-4.
http://cl.ly/image/3m2U1N0q1B2l
update
bolo:~ Michelin$ xcode-select -p
Usage: xcode-select -print-path
or: xcode-select -switch <xcode_folder_path>
or: xcode-select -version
Arguments:
-print-path Prints the path of the current Xcode folder
-switch <xcode_folder_path> Sets the path for the current Xcode folder
-version Prints xcode-select version information
bolo:~ Michelin$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
and
bolo:~ Michelin$ locate */bin/gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
/Library/Developer/CommandLineTools/usr/bin/gcc
bolo:~ Michelin$
update (12:18pm)
on my system
bolo:~ Michelin$ ls /usr/local/bin/gc
gcc-4.2 gcov-4.2
My bash_profile
export PATH=/usr/local/bin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
source ~/.rvm/scripts/rvm
and after.
bolo:~ Michelin$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Michelin/.rvm/bin
Thanks

Ok probleme solved. I have replaced my bin folder by other one and now every works.

Maverick is not came with .bash_profile. Need to change bash_profile using vim or nano command.
Edit with following...
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

Related

ERROR: The Python zlib extension was not compiled. Missing the zlib?

I'm trying to install Python 2.7.7 using Homebrew AND pyenv on my Mac (MacBook Air, OSX 12.5 Monterrey, 1.6 GHz Dual-Core Intel Core i5) but keep getting this “Missing zlib” error.
Just for reference, I have done the following:
When I Installed pyenv, I ran command nano ~/.bashrc (I'm using bash shell) - and pasted and saved on /.bashrc ---> eval "$(pyenv init -)"
then I ran pyenv install 2.7.7 (didn't work and found online step 3.)
CPPFLAGS="-I$(brew --prefix zlib)/include" pyenv install -v 2.7.7 (Again, same error and did step 4.)
ran brew reinstall zlib and overrode on "/.bashrc" eval "$(pyenv init -)" to:
export PATH="/usr/local/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
-------------Start of Error ----------------
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7 python2)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7-config python2-config)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (OS X 12.5 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727
Results logged to /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727.log
Last 10 log lines:
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ software update
-bash: software: command not found
------------- End of Error -----------------
Any idea?.... Please let me know... I'd highly appreciate it
With a similar configuration, 2018 MBA on Monterey, I was having the same problem as you with pyenv install 2.7.6
I was able to go past the missing zlib issue with the following additions to the shell's profile:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
As a side note, the installation still didn't go through due to a different issue:
That OpenSSL issue has to do with OpenSSL 1.0 being EOL, more info here.
At the end I just went with 2.7.14 which is OpenSSL 2.0 compatible and good enough for my use case.
command line tools are already installed, use "Software Update" to install updates
This is indicating you need to use the Settings to update the command line tools.
$ software update
-bash: software: command not found
There is no command line called "software". Instead open system preferences. Then click on this:
Install any updates requested.

Set Openssl 1.1.1 as a default version

I have macOS BigSur 11.6. When I run openssl version I get
LibreSSL 2.8.3
What I want is to get this output:
OpenSSL 1.1.1l 24 Aug 2021
In the /usr/local/opt/ there are folders: openssl, openssl#3, openssl#1.1.
I ran these commands:
brew install openssl
brew reinstall openssl#3
sudo ln -sfn /usr/local/Cellar/openssl#1.1 /usr/local/opt/openssl
I placed the line export PATH="/usr/local/opt/openssl#1.1/bin:$PATH" in files ~/.profile, ~/.bash_profile, ~/bashrc.
But nothing helps. How can I make the default openssl version 1.1?
Plese, don't offer commands as in this or this questions. These commands don't change anything: as soon as I open a new session I get the same LibreSSL 2.8.3 instead of opessl 1.1.1l
export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"
source ~/.profile
source ~/.bash_profile
source ~/.bashrc
UPD 1
type -a openssl shows:
openssl is /usr/bin/openssl
echo $PATH shows:
/usr/local/opt/libressl/bin:/usr/local/opt/python#3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
UPD 2
Just made unset PATH, set in files ~/.profile, ~/.bash_profile, ~/bashrc the same line export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/openssl#1.1/bin:$PATH" and ran this line in bash. Anyway there is the same output for openssl version: LibreSSL 2.8.3.
this bash --norc -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; set -x; source ~/.bash_profile' shows:
+ source /Users/sgalich/.bash_profile
++ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/openssl#1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/openssl#1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
++ export LDFLAGS=-L/usr/local/opt/openssl#1.1/lib
++ LDFLAGS=-L/usr/local/opt/openssl#1.1/lib
++ export CPPFLAGS=-I/usr/local/opt/openssl#1.1/include
++ CPPFLAGS=-I/usr/local/opt/openssl#1.1/include
++ export CPATH=/usr/local/opt/openssl#1.1/include
++ CPATH=/usr/local/opt/openssl#1.1/include
++ export LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
++ LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
++ export DYLD_LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
++ DYLD_LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
++ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
++ DYLD_FALLBACK_LIBRARY_PATH=/usr/local/opt/openssl#1.1/lib
So the issue was in my PATH variable. My problem was solved after adding this line in the ~/.bash_profile:
PATH="/usr/local/opt/openssl#1.1/bin:$PATH"
Thanks #Gordon Davisson for the answer!
On MacOS Monterey (with M1 chip) the paths differed.
I added the following to ~/.zshrc
export PATH="/opt/homebrew/opt/openssl#1.1/bin:$PATH"

facing issues while installing Golang

I am facing some issues while installing go lang, have used below approach to install it.
sudo apt update
$ sudo curl -O https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz
$ sudo tar -xvf go1.10.1.linux-amd64.tar.gz
$ sudo mv go /usr/local
everything went fine till the above step.
But when I am giving below command, I am getting a message
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
Message: bash: export: '/usr/local/go/bin': not a valid identifier
$ source ~/.profile
Try this script:
git clone https://github.com/udhos/update-golang
cd update-golang
sudo ./update-golang.sh
Full details: https://github.com/udhos/update-golang

installing komozer on fedora 18 ?

i have download kompozer and installed by following step:
~> sudo yum install compat-libstdc++-33
~> sudo cp ~/Download/kompozer-077-i686.tgz /usr/local/src/kompozer/
~> cd /usr/local/src/kompozer
~> sudo tar vfzx kompozer-077-i686.tgz
~> sudo rm kompozer-077-i686.tgx
~> sudo mv kompozer kompozer-077
~> sudo ln -s /usr/local/src/kompozer/kompozer-077/kompozer /usr/local/bin/.
~> source ~/.tcshrc
on running this command
~> kompozer &
i application doesn't start and got an error on terminal :
[root#HyperWorkstation kompozer]# /usr/local/src/kompozer/kompozer-077/run-mozilla.sh:
/usr/local/src/kompozer/kompozer-077/kompozer-bin: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
please help what goes wrong actually i feel bad may happened in .tcshrc file
........... thanx for reply in advance
# yum install ld-linux.so.2
or
$ tar xvzf kompozer-0.8b3.es-ES.gcc4.2-i686.tar.gz
$ cd kompozer
$ ./kompozer-bin

When I type $ gcc into the mac Terminal I get a "-bash: gcc: command not found"

However, it works when I type:
$ gcc-4.2
Find where gcc-4.2 is installed and go into that directory:
$ cd $(which gcc-4.2)
Check if there is a gcc symlink:
$ ls gcc
If there isn't one, create it:
$ ln -s gcc-4.2 gcc
I got it: all was well after I installed command line tools in Xcode > Preferences > Downloads.

Resources