Octave error on El Capitan, not writable error - terminal

I'm trying to install Octave on my El Capitan Macbook but I'm getting an odd error.
OSX-3:~ me$ brew install octave
==> Installing octave from homebrew/science
Error: You must `brew link jpeg libtiff libpng freetype gmp fontconfig gd lua` before homebrew/science/octave can be installed
So I do what it told me to do ...
OSX-3:~ me$ brew link jpeg libtiff libpng freetype gmp fontconfig gd lua
Linking /usr/local/Cellar/jpeg/8d...
Error: Could not symlink include/jconfig.h
/usr/local/include is not writable.
I tried "sudo brew" as well, but that did not work either.

Due to El Capitan update your /usr/local ownership might have been reseted to its default root:wheel and are not writable without sudo privileges.
Brew and sudo doesn't work well together as brew is intended to write in folder owned by a non root user.
To fix this you have to chown /usr/local :
sudo chown -R $(whoami):admin /usr/local
Have a look at this issue on the homebrew's github for more informations.

Related

How can I install PostGIS to Mac Osx ? (I always get "brew link libpng libtiff proj" error)

I tried to install "gdal" or "PostGIS" to my Mac OSX from homebrew but I've got an error "brew link libpng libtiff proj".
When I tried to "brew linklibpng", I've got an error:
Error: Could not symlink share/man/man3/libpng.3
I've also tried 'brew update', uninstall and install "libpng libtiff proj" but there is always problem as:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man3/libpng.3
/usr/local/share/man/man3 is not writable.
What's the problem there?
$ brew install gdal
$ Error: You must `brew link libpng libtiff proj` before gdal can be installed
$ brew link libpng
Linking /usr/local/Cellar/libpng/1.6.19...
Error: Could not symlink share/man/man3/libpng.3
/usr/local/share/man/man3 is not writable.

Can't install imagemagick and rmagick on OSX Mavericks

I'm having problems to install imagemacgick and rmagick
➜ scripts brew install imagemagick
Error: You must `brew link freetype' before imagemagick can be installed
➜ scripts brew install freetype
Warning: freetype-2.5.3_1 already installed
➜ scripts brew unlink freetype && brew link freetype
Unlinking /usr/local/Cellar/freetype/2.5.3_1... 1 symlinks removed
Linking /usr/local/Cellar/freetype/2.5.3_1... Error: No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
brew remove freetype && brew install freetype
Uninstalling /usr/local/Cellar/freetype/2.5.3_1...
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.5.3
Already downloaded: /Library/Caches/Homebrew/freetype-2.5.3_1.mavericks.bottle.1.tar.gz
==> Pouring freetype-2.5.3_1.mavericks.bottle.1.tar.gz
Error: An unexpected error occurred during the brew link step
The formula built, but is not symlinked into /usr/local
No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
Error: No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
There is some problem with freetype
I've found a solution here:
brew uninstall freetype
brew install https://raw.github.com/mxcl/homebrew/04406ae9a0aa093aaaf61ab06dc1d81672c41fee/Library/Formula/freetype.rb
brew install freetype
brew install imagemagick
It worked for me
Update:
It seems it's not recommended to checkout the repository directly and you can install by using a link with the revision hash
I've updated my answer accordingly
Also, please note that i've used a more recent hash than the one in the link, otherwise imagemagick will complain about the version of libfreetype.6.dylib

Qmake installed but not linked - Using Brew - Mac

I have installed Qmake using brew.
brew install qt
The results which the terminal brings is:
Warning: qt-4.8.6 already installed, it's just not linked
This is a problem with brew to install correct the things? because I am having the same "not linked" problem with PostgreSQL.
Thks
I found the problem:
The Brew can't write to the folder /usr/local/lib/
So I used the command: sudo chown -R $USER /usr/local/lib
I found a similar error here: Brew doctor says: "Warning: /usr/local/include isn't writable."
But this problem was with another folder permission.
The Brew can't write to the folder
/usr/local/lib/
So I used the command:
sudo chown -R $USER /usr/local/lib
After need uninstall and install qt again. (If you run reinstall the problem will continuous)
brew uninstall qt
brew install qt
I found a similar error here:
Brew doctor says: “Warning: /usr/local/include isn't writable.”
But this problem was with another folder permission.
Try
brew link qt
Which should tell brew to link the package.
If that doesn't work, someone else had a similar problem here: Error: The 'brew link' step did not complete successfully

Cannot install ruby-1.9.2 in Mac OSX 10.8.1 due to symlink error

First, I tried the common rvm install.
rvm install 1.9.2
However, the following error was shown:
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
Then I run
rvm requirements
and find these following part of output useful
Right now Ruby requires gcc to compile, but Xcode 4.2 and later no longer ship with gcc. Instead they ship with llvm-gcc (to which gcc is a symlink) and clang, neither of which are supported for building Ruby. Xcode 4.1 was the last version to ship gcc, which was /usr/bin/gcc-4.2.
Xcode 4.1 and earlier:
- Ruby will build fine.
Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
* Install apple-gcc42 from Homebrew
* Install osx-gcc-installer
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
This can live side by side with an existing Xcode 4.2+ install or Command Line Tools for Xcode.
so I tried:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
However, I got the following error
Warning: Could not link apple-gcc42. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link apple-gcc42'
==> Summary
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3: 104 files, 75M, built in 23 seconds
kanitw:shell.venturelab.com kanitw$ brew link apple-gcc42
Linking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... Warning: Could not link apple-gcc42. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc
/usr/local/include is not writable. You should change its permissions.
What would be my best solution? I kinda remember from somewhere that I should not use sudo with brew since I will mess up the whole installation.
You can change /usr/local directory owner
sudo chown -R `whoami` /usr/local
But, if you have mysql installed, you mast fix its owner
sudo chown -R mysql:mysql /usr/local/mysql
You should run brew doctor and then change the permissions accordingly. There might be other issues.
Change the permissions of your /usr/local directory and try again.

ImageMagick and OS X Lion trouble

[edit] I was troubleshooting problems with my development environment when I noticed one of my problems was the dependency on ImageMagick, since it's a vital part of my app.
After upgrading to OS X Lion (10.7) i no longer had ImageMagick available, i then tried installing again using MacPorts without success, i then installed from source, and the install wasn't very successfully i had convert and identify but it output error messages that i unfortunately dont have anymore, i by some strange reason decided to remove all of my MacPort libraries and started using Homebrew, i tried installing ImageMagick, it installs OK but when i try to use it throws this error
dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
Referenced from: /usr/local/bin/convert
Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5
I read online but i have no clue on whats going on here, i found that libltdl is called libtool, and that i obviously need to upgrade it to a newer version, but i havent found any indication of how or where to find the source, or if this should be already be handled by homebrew and why it hasn't.
I tried installing ImageMagick again from source using this installer script https://github.com/masterkain/ImageMagick-sl but when i try to use convert it throws a similar error.
$ convert gnome.jpg -resize 50% gnome_.jpg
dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
Referenced from: /usr/local/bin/convert
Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5
$ which convert
/usr/local/bin/convert
What can i do to solve my problem?
On 10.8 I solved this issue with:
brew install libtool --universal
brew link libtool
If you don't know what brew is, visit https://github.com/mxcl/homebrew and its wiki.
brew uninstall imagemagick
brew install imagemagick --build-from-source
worked for me
I too use homebrew for installing packages but imagemagick stopped working after upgrading OSX 10.8 to 10.9 (Mavericks). I had to do the following steps:
brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew install imagemagick --build-from-source
Why the --build-from-source? Well for me running brew install imagemagick on its own to install the pre-built binary wasn't sufficient; it fixed the original 'dyln' error but was replaced with:
unable to load module `/usr/local/Cellar/imagemagick/6.8.7-7/lib/ImageMagick//modules-Q16/coders/png.la': file not found # error/module.c/OpenModule/1277
I also upgraded to Lion and lost ImageMagick, although i'm getting different errors.
i found a Lion distribution on imagemagick.org. not a big fan of the DYLD_LIBRARY_PATH environment variable but it works.
ok scratch that. i just downloaded the ImageMagick source and re-compiled:
cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.2-7/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
On Mountain Lion OSX,
Even with the updated brew for imagemagick(which includes libtool), this error seemed to happen to me.
so i fixed it using the following commands
brew uninstall libtool
brew install libtool --universal
brew link libtool --force
For others looking and still having trouble, I used this:
https://github.com/maddox/magick-installer
On 10.8, with brew, I solved this issue with:
brew install graphicsmagick
For the googlers: If you happened to have it installed with brew beforehand, you'll need to reinstall by running brew uninstall graphicsmagick before installing again. Easy.
This helped me after restoring OS X 10.9.3 from time machine.
brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew unlink libtool && brew link libtool
brew install imagemagick
brew install Homebrew/python/pillow
brew link --overwrite pillow
The same problem might occur with OSX Mountain Lion (preview 4). I had to configure some parts separately because there are some library incompatibilities:
dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /usr/local/bin/convert
Reason: Incompatible library version: convert requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0
I had to add --with-fontconfig=no, --with-lzma=no and use /opt/local/share/... instead of /usr/local/share/... for the ghostscript fonts:
cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.8-0/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-fontconfig=no --with-gs-font-dir=/opt/local/share/ghostscript/fonts --with-lzma=no
make
sudo make install
I could fix the ImageMagick problem by installing corresponding package from cactuslab site.
Then by setting the PATH variables in terminal:
export MAGICK_HOME="/usr/local/ImageMagick/"
export PATH="$MAGICK_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
If you're using Homebrew, try the following command:
brew doctor
to diagnose the common problems.
One of it could be to remove DYLD_FALLBACK_LIBRARY_PATH variable from your ~/.profile if you have it.
Or you have to re-install libtool by:
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
I tried most of the solutions above and they didn't work. Here's how I fixed my problem:
brew install imagemagick;
brew install freetype;
cd /usr/X11/lib/;
sudo mv libfreetype.6.dylib libfreetype.6.dylib.orig;
sudo ln -s /usr/local/opt/freetype/lib/libfreetype.6.dylib libfreetype.6.dylib
Tested on OS X 10.7.2
For 10.7.8 and up, you have to install the php version and not the pecl version. Depending on your version of php you've install with Macports you can either do:
sudo port install php-imagick
sudo port install php5-imagick
sudo port install php53-imagick
sudo port install php54-imagick
Remember only to do the one of your current version of php.

Resources