Category: OSX

RVM on OSX Snow Leopard & readline errors

Posted by – March 19, 2010

There seems to be an issue with the system readline utility which prevents Rubies installed by rvm from being compiled. A possible fix to this is to install your own version of readline.

Errors in the make log:

readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1

Your own readline

Compile and install your own readline:

curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz
tar xzvf readline-6.1.tar.gz
cd readline-6.1
./configure --prefix=/usr/local
make
sudo make install
cd ..

Give rvm another try …

First you have to remove Ruby versions you tried to compile before:

rvm remove 1.9.1

The following command with a reference to the newly installed newline should do the job:

rvm install 1.9.1 -C --with-readline-dir=/usr/local/

Reduce PDF file size on OSX

Posted by – March 13, 2010

Some days ago I needed to reduce a PDF file to send it by e-mail, but the integrated Quartz-Filter “Reduce file size” which is available per default in all programs able to save as or export in the PDF format, was just not giving the results I expected: The file site was largely minimized but Image based pages where just from a very bad quality.

The trouble with the included “Reduce file size”-filter is that all pictures in the document are reduced to a size of 512×128 pixels which is often not sufficient for scanned documents.

After some research I found out that it’s possible to create your own Quartz-Filters which are afterwards available system wide.

Create your own “Reduce file size” -Quartz-Filter:

  1. open the ColorSync utility and choose “Filter”
  2. create a new filter by clicking the “+”
  3. add an action to the filter by clicking on the arrow on the right: first a “picture adaption” -filter to reduce the file size (I chose to reduce the size by 60%, but you can play around with that)
  4. add a second action to compress all images (I chose JPG and maximal compression)
  5. Voilà – your new filter is ready and available in the PDF-Viewer Preview

With my custom filter I was able to reduce the PDF file size from 4.8 to 1.2 MB and maintain good quality at the same time.