Posts Tagged ‘lion’

MacPorts mysql5-server not working on boot

Friday, February 22nd, 2013 | Life, Tech

If you’ve installed MacPorts’ mysql5-server, you may find that it doesn’t work after a restart.

This can be resolved by running the following commands to make sure you’ve killed off everything MySQL related.

sudo port unload mysql5-server
ps -ax | grep mysql
sudo kill 

Once you have done this, load it again.

sudo port load mysql5-server

Not it should be working. This is fine, but quickly gets very annoying every time you restart your computer! A common cause is that you have a MySQL sock file in your tmp directory. Removing this may allow it to start automatically.

cd /tmp
rm -f mysql.sock

Once removed, restart your computer and see if MySQL works first time – hopefully, it will.

No acceptable C compiler found on Mac

Monday, February 4th, 2013 | Programming, Tech

If you’re trying to compile from source, you may get an error similar to the following.

mac configure: error: no acceptable C compiler found in $PATH

This may be because you haven’t installed Xcode. If you have, something has broken, and you need to reinstall it. First, remove it with the following command.

mac configure: error: no acceptable C compiler found in $PATH

Now restart your system and once it has started again, go to Applications and select Install Xcode. This will reinstall it.

Imagick not loading on MAMP for Mac

Thursday, January 17th, 2013 | Life, Tech

If you’re running MAMP and you’ve finally managed to get the Imagick extension to add ImageMagick support compiled, the battle may not be over yet. There are more things you need to do. You might get an error similar to the following.

Firstly, imagick.so was probably installed into the sytem’s PHP extension directory. So you might need to copy this into MAMP’s directory. Don’t just copy and paste the code below as you need to check the paths are correct for your system.

php -i | grep extension_dir
cp /usr/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/

Secondly, some of the libraries are out of date. You might get an error like the following.

[01-Jun-2012 08:46:22] PHP Warning:  PHP Startup: Unable to load dynamic library 
'/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so'
 - dlopen(/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so, 9): Library not loaded: /opt/local/lib/libjpeg.8.dylib
  Referenced from: /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/imagick.so
  Reason: Incompatible library version: imagick.so requires version 13.0.0 or later,
but libjpeg.8.dylib provides version 12.0.0 in Unknown on line 0
[01-Jun-2012 08:51:54] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/yaml.so' - dlopen(/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/yaml.so, 9):
image not found in Unknown on line 0

We can solve this by editing a configuration file.

sudo vim /Applications/MAMP/Library/bin/envvars

Comment out the first two lines below and add the last one.

#DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#export DYLD_LIBRARY_PATH
export PATH="$PATH:/opt/local/bin"

This should override out of date libraries such as libjpeg. If you’re still having problems, you can manually copy in the freetype library too.

cp /opt/local/lib/libfreetype.6.dylib /Applications/MAMP/Library/lib/

Though in theory this step should not be required. Restart Apache and you should see Imagick appear on the phpinfo() output.

Using whereis on Mac OS X Lion

Saturday, January 5th, 2013 | Life, Tech

Linux has a great tool called whereis that allows you to find the location of an executable. For example, if you want to know what PHP binary you are using, you could use the following command.

$ whereis php
/usr/local/php

However, if you run this on Mac it will often return you a black result, even though you know the command works!

$ whereis convert

The solution is to use which instead, which does the the same thing, but actually returns results.

$ which convert
/opt/local/bin/convert

Great for finding those extra mysterious programmes.

Installing PECL YAML on Mac OSX Lion

Sunday, December 16th, 2012 | Programming, Tech

If you are trying to install YAML via PECL on Lion, you may get an error such as the following.

configure: error: Please install libyaml
ERROR: `/private/tmp/pear/install/yaml/configure --with-yaml' failed

Some solutions on the internet suggest installing it via a package manager.

rvm pkg install libyaml

However, although this process will claim to work, when you come to run the command again, it will fail at the same point. Instead, you need to download libyaml, which you can do here, then extract it, cd into the directory and run the following commands.

./configure
make
make install

You don’t need to sudo. You should now be able to run the install command again.

sudo pecl install --ignore-errors yaml

This time it should be successful.

Conflict error on PECL YAML

Monday, December 10th, 2012 | Programming, Tech

If you are trying to install PECL YAML on Mac OS X Lion, you may find you get a conflict with an error message similar to the following.

WARNING: pecl.php.net/yaml: conflicting files found:
yaml/LICENSE (pear.symfony-project.com/yaml)

This error is documented on GitHub and as it is not critical, can be overcome by turning off errors.

pecl install --ignore-errors yaml

On running that command, it should no longer stop at that point.

Command not found on updatedb on Mac OSX Lion

Tuesday, October 23rd, 2012 | Life, Tech

If you’re running Mac OSX Lion and trying to update your locate db, you may get the following error message.

-bash: updatedb: command not found

You can call updatedb by using its full path instead.

/usr/libexec/locate.updatedb

You could also create a symlink in your bin directory which would then allow you to just call updatedb as normal.

Add Scala to your system path on Mac

Wednesday, September 5th, 2012 | Programming, Tech

Lets say you are running Mac OS X Lion and you have installed Scala to /usr/local/scala. To access scala from the terminal you need to do the following.

cd /etc/paths.d/
sudo vim scala

Add one line with the following in.

/usr/local/scala/bin

Save the file and restart terminal. You’ll now be able to use scala from the terminal.

OSX Lion

Monday, October 31st, 2011 | Reviews, Tech

I recently updated my MacBook Pro to the new version of OSX, Lion.

So far, I’m not overly impressed. Firstly, when I upgraded Finder totally broke itself. It added a number of documents to the devices bar on the left, which I couldn’t click on, but because they had a long filename they would expand the devices bar all the way over, so every time I opened a Finder window I had to drag it back.

They’ve also got rid of Spaces which allows you to have multiple desktops. They’ve replaced this with Desktops, which is basically the same thing, except that you can only tile them horizontally, whereas before you could set up a grid and scroll each way. Desktops is quite good because you you can gesture from one to the other, but I Miss my grid.

They’ve also taken Dashboard and moved it onto it’s own Desktop which is annoying because the only time I use Dashboard is when I need a calculator, and I need it as an overlay because I want to input some figures which I’m currently looking at.

Some of the new gestures are quite nice, but I now need to use five fingers to show my desktop, which is quite a difficult gesture to perform. I’ve also noticed that it’s just not quite as fast as Snow Leopard and the new full screen apps system just isn’t as seamless as it is in Microsoft Windows. Finally, there are just a few bugs too that need working out, especially with the new scrolling system.

Other than that, it has some quite nice features. I haven’t used Launchpad or Mission Control so I’m not too fussed about those, but gesturing between Desktops is good and being able to turn wi-fi on and off without being prompted for the admin password is good. Unfortunately, if that is all I have to say about a brand new version of an operating system, it’s a bit of a poor show.

osx-lion