Error installing pear in OS X El Capitan - macos

I try it to install pear following this instructions
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
Then I set the Path and I type in terminal pear I get this message
/usr/local/Cellar/php55/5.5.30/bin/pear: line 28: /usr/local/Cellar/php55/5.5.23/bin/php: No such file or directory
/usr/local/Cellar/php55/5.5.30/bin/pear: line 28: exec: /usr/local/Cellar/php55/5.5.23/bin/php: cannot execute: No such file or directory
Php was installed I few month ago with homebrew, I try several times and always I get the same error, there is not way to installed.

To make it consistent, you should install PHP and pear using the same method (via Homebrew), e.g.:
brew tap homebrew/science
brew install php56 pear

The correct answer (thanks to https://stackoverflow.com/a/36547172/1953740) is to install brew with --with-pear:
brew reinstall php56 --with-pear
The homebrew/science/pear package mentioned in the other comment is not the PHP package manager; it's something different.

fixing it by creating symlink,
For example, I have my php executable file in MacPorts so for me it will be like this:
sudo ln -s /opt/local/bin/php56 /usr/local/Cellar/php55/5.5.23/bin/php
PS tested on macOS Hight Sierra 10.13.3, but it will work for El Capitan too

Related

msgmerge on macos Catalina

I am trying to run a unix command line for some i18n work on a project. Using gettext library my issue is about running msgmerge
$ msgmerge
zsh: command not found: msgmerge
I tried brew instal gettext and brew link gettext but with no success. This was working well on my previous machine, but can't make it work on a fresh install.
I can confirm binary is available in /usr/local/opt/gettext/bin/msgmerge.
Fixed. When running brew reinstall gettext, command actually give the answer:
If you need to have gettext first in your PATH run:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc
Export is only triggered when opening a new zsh prompt, PATH was not updated yet and worked when I re-openned a new window.
I tried running this brew link gettext --force, but I was getting:
$ brew install gettext
Warning: gettext 0.20.2 is already installed and up-to-date
To reinstall 0.20.2, run `brew reinstall gettext`
$ brew link gettext --force
Warning: Refusing to link macOS provided/shadowed software: gettext
If you need to have gettext first in your PATH run:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
For compilers to find gettext you may need to set:
export LDFLAGS="-L/usr/local/opt/gettext/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include"
Then, I just added it to the system path with:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
Related:
https://apple.stackexchange.com/questions/299048/can-not-use-the-gettext-which-is-installed-by-brew
Homebrew refusing to link OpenSSL
How to install gettext on MacOS X
Installed, just not linked

This terminal won't let me run or install cocoa pods because I am on MacOS Catalina Beta?

I am interested in installing one of the GitHub repos that requires installing CocoaPods. There is no problem with my terminal (seems fine in a normal macOS version). I have one problem though: terminal is not installing CocoaPods, seemingly because I'm on the macOS Catalina beta?
I did install the pod 'Card' from Podfile which finished but after that Podfile closes. I am going running "pod install" on the terminal, then the only error that I get is:
-bash: /usr/local/bin/pod: /
System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory".
Does someone know how to fix this issue for macOS Catalina?
sudo gem install -n /usr/local/bin cocoapods
worked for me
Use
brew install cocoapods --build-from-source
The Mojave bottle is linked to a different version of Ruby. The --build-from-source option will link the cocoapods gem to the Catalina version of Ruby.
I also encountered this issue when I upgraded to Catalina and XCode 11. Here's what I did to fix this:
Select Command Line Tools in XCode.
XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
In terminal execute:
sudo gem install cocoapods -n /usr/local/bin
Try this to get cocopods works on macOS Catalina
$ brew cleanup -d -v
$ brew install cocoapods
I fixed it by installing cocoa pod again.
sudo gem install cocoapods -n /usr/local/bin
I had not been able to solve use this one
sudo gem install -n /usr/local/bin cocoapods
Before this command I ran the following command and reinstalled cocoapod.
xcode-select --install
.
This worked for me
xcode-select --install
sudo gem install -n /usr/local/bin cocoapods
I had this problem with Catalina, to solve I have to made the following steps:
Install XCode Command Line Tools, I recommend install the HomeBrew to solve that dependency:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Execute this command to reinstall cocoa pods: sudo gem install -n /usr/local/bin cocoapods
[![If cannot install new version cocoapods, example below:
1. Please remove Command line tools
sudo rm -rf /Library/Developer/CommandLineTools
2. Install new Command line tools version
sudo xcode-select --install
3. after installing run below command
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg]
Check this one, worked for me
Go to Xcode preferences -> Locations 'tab'.
Check the Command Line Tools section. If it's blank, make sure your current command line tools is selected.
XCode > Preferences > Locations > Command Line Tools > XCode 11.X.X
Run sudo gem install -n /usr/local/bin cocoapods
So, issue is that in Mac OSX Catalina. The folder path /usr/local/bin is private.
So,
Step 1: Install Homebrew. "Homebrew lets your access private folders and enables them to public".
Step 2: Restart Terminal or restart Mac OSX.
Step 3: Run sudo gem install cocoapods or sudo gem install -n /usr/local/bin cocoapods
Step 4: Let the setup complete
Step 5: Run pod setup
Finished :)
Try to install cocoapods using brew
brew install cocoapods --build-from-source
if u have already installed cocoapods using brew it will not let you install cocoapods
then try
brew link --overwrite cocoapods
then write
pod setup --verbose
hope it will work.

Install OpenCV on Mac - VirtualEnv (Updated bash_profile and pip error)

I'm trying to install OpenCV on my Mac (OS X 10.11.3) using this tutorial because it uses a VirtualEnv, which is a way to ensure consistency in development.
I skipped Steps 1&2 since I already have Xcode and Homebrew. Step 3 worked well (after updating ~/.bash_profile as instructed):
User:~ user$ brew update
Already up-to-date.
User:~ user$ source ~/.bash_profile
User:~ user$ which python
/usr/local/bin/python
User:~ user$
The trouble is in Step 4:
User:~ user$ pip install virtualenv virtualenvwrapper
-bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
User:~ user$
This is probably because I'm in the local bin due to adding this to ~/.bash_profile from Step 3:
# Homebrew
export PATH=/usr/local/bin:$PATH
This basically means I can't access pip from that location, but when I try to install it locally (with the above lines added in ~/.bash_profile), it says:
User:~ user$ brew install pip
Error: No available formula with the name "pip"
Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can install
pip via the instructions at:
https://pip.readthedocs.org/en/stable/installing/#install-pip
User:~ user$
How can I access pip with my updated ~/.bash_profile from Step 3? Thanks!
Ok, I figured out the problem.
I was getting the same errors as this stackoverflow question, so I ran the recommended
brew link python
which encountered the same errors as this stackoverflow question, so I ran the recommended
brew link --overwrite python
which seemed to correct the problem and allows me to run pip while accessing Homebrew packages first.

Error in running Homebrew on Mac OS X mavericks

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -e:70: warning: Insecure world writable dir /usr in PATH, mode 040777 It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again: rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
I have this on my terminal but I cant make use of homebrew. I need to use homebrew to install django pyhton web framework. However I don't seem to get the error here. It says its already installed but none of the brew commands work.
ghochee-macbook-pro:logs streamoid$ brew doctor -bash: brew: command not found <<<<<
Can anyone please help? I also see that there is no .bash_profile file with the PATH variable set, am I looking the right folder and file here?
It sounds like /usr/local/bin isn't on your $PATH. You can add it by running the following command in the terminal:
echo 'export PATH="/usr/local/bin:${PATH}"' >> ~/.bash_profile
Then restart your terminal for the changes to take affect.

How to install JSON.pm perl module on OSX

I am trying to use the po2json parser/converter from the JS gettext library (http://jsgettext.berlios.de/), but when I try to convert I get this error:
Can't locate JSON.pm in #INC (#INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at ./po2json line 23.
BEGIN failed--compilation aborted at ./po2json line 23.
As far as I understand I am missing a perl module, namely JSON.pm, an I think it's this one: http://cpansearch.perl.org/src/MAKAMAKA/JSON-2.53/lib/JSON.pm
Now, how do I install it on OSX? I am using Mountain Lion.
I tried to do cpan install JSON, but it doesn't work, I get the following error:
Writing Makefile for JSON
MAKAMAKA/JSON-2.53.tar.gz
make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Use homebrew to install cpanm:
brew install cpanm
Then you can install JSON with
sudo cpanm install JSON
The output said that make didn't return success. Probably due to some dependency.
Try using cpanm http://search.cpan.org/~miyagawa/App-cpanminus-1.5017/bin/cpanm, it's really hassle free and bootstrapped quite well (no need to install other stuff).
Install using this:
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpan install JSON Having the JSON in all caps made it work for me.
I know this is an old topic, but wanted to share my solution after finding that I needed JSON when trying to use zap2xml (perl based). I was getting the error: "Can't locate JSON.pm in #INC..." after installing perl via Homebrew.
This is how I installed JSON via Homebrew. I will also include the steps required to install Homebrew (for those who would like to know). ;)
Prerequisites:
Install Xcode from the App Store (Download):
https://itunes.apple.com/us/app/xcode/id497799835
Install Command Line Tools for Xcode (Run in Terminal):
xcode-select --install
Install Homebrew (Run in Terminal):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update Homebrew (Run in Terminal):
brew update
brew upgrade
brew doctor (correct issues found by brew doctor. Instructions will be given by The Doctor. :P)
Install cpanminus (Run in Terminal):
brew install cpanm
Check perl (Run in Terminal):
which perl
perl -V (with a capital -V)
Check/Install JSON module (Run in Terminal):
sudo cpanm -v JSON
DONE.
Following worked for me:
Run on terminal:
sudo perl -MCPAN -e shell
you should get the cpan shell prompt and run below commond at cpan shell:
cpan[1]> install JSON
Regards,
Anand Choubey
this way is OK, Follows the Command:sudo apt-get install libjson-perl

Resources