Posts Tagged ‘mac os x’

Ruby on Rails, jQuery and YUI API Docs Available as Mac OS X Dictionary Binaries

Posted 05 Dec 2009 — by admin
Category Documentation

I came across an awesome tool this morning. Priit Haamer has chunked Ruby on Rails, jQuery, and some of YUI documentation into native Mac OS X dictionary binaries. This lets you search those API docs from Spotlight, TextMate, any application that uses the dictionary app!

I have tested the Ruby on Rails API within TextMate. Hover over any function and hit ctl+cmd+d and a little popup will give you a glimpse at the API docs. Seems like a nice alternative to ACK or the normal TextMate function lookup.

More information and installation instructions are available at Priit’s site http://www.priithaamer.com/blog

Here is a nice video of the tool

http://www.vimeo.com/3848473

Disk Usage Information on Mac OS X

Posted 04 Nov 2009 — by admin
Category mac os x

Get disk usage information about the Desktop

$ du -h -d 0 Desktop
14G	Desktop

Information about how much free space is available on computer

$ df -lh
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/disk0s2  111Gi  109Gi  2.3Gi    98%    /

You can read more about the flags with the man pages

$ man du
$ man df

This is my 100th post!!!

Installing Scala on Mac OS X Leopard

Posted 01 Oct 2009 — by admin
Category Programming

I followed the instructions from here http://arvinderkang.com/2009/09/01/installing-scala-on-snow-leopard/ but I used version 2.7.6 (rather than .5) I installed scala under /usr/local/scala so I had to include it to my path. Type

vim .bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/scala/scala-2.7.6.final/bin:$PATH"

Now to download and install…

curl -O http://www.scala-lang.org/downloads/distrib/files/scala-2.7.6.final-installer.jar
sudo java -jar scala-2.7.6.final-installer.jar

This will launch an installer. Just follow the instructions and when it asks for the destination folder, remember that it’s in /usr/local/scala
Simple as pie!

Fixing MySQL for Rails 2.2 Development on Mac OS X

Posted 03 Jul 2009 — by admin
Category Programming

Oh what trouble Rails 2.2 and MySQL (on Mac OS X) can be. Rails, as of version >= 2.2, no longer comes bundled with the MySQL adapter. This means you’ll need to install it yourself, but it appears that the gem for installing it is also broken.

This will fail

gem install mysql

What you need to do is tell the gem which MySQL to use. I installed MySQL with mac ports, http://macports.org , so I need to specify this when I run the installation command.

gem install mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

Check out an earlier post explaining how to install MySQL with mac ports http://seanbehan.com/programming/installing-sphinx-search-engine-on-mac-os-x-or-ld-library-not-found-for-lmysqlclient/

You’re not out of the woods yet. Rails needs to know the location of the socket it uses to connect to the MySQL server. I created a symbolic link to the location Rails normally looks for this socket. You could specify the location of the socket in the config/database.yml file, however, then you’ll need to do this with each of your applications.

ln -s /private/tmp/mysql.sock /opt/local/var/run/mysql5/mysqld.sock

If there is an easier way to get MySQL back for Rails on Mac OS X please let me know. I’d love a quick fix to this problem.

Installing Sphinx Search Engine on Mac OS X… or ld: library not found for -lmysqlclient

Posted 30 Jun 2009 — by admin
Category Programming

If you are trying to install Sphinx on Mac OS X, it will most likely fail. The current version of MySQL bundled with Mac OS X is not supported and therefore, it will spit out the error message because it can’t find the correct libraries.

 ld: library not found for -lmysqlclient

There is a quick solution to the problem -upgrade mysql! You’ll need Mac Ports installed, available at

http://macports.org/

Run the command

sudo port install mysql5

This will not destroy any existing data from your previous MySQL installation. The mac port installation will take a while, and it will appear as if it is just hanging. It’s not. It just takes a while. I clocked it at 15 minutes on a relatively fast network connection. Drink a cappuccino!

After you have the upgrade you’ll need to download Sphinx available at:
http://sphinxsearch.com/downloads.html (latest stable) and build the Sphinx engine from source like so:

wget http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
tar xzvf sphinx-0.9.8.1.tar.gz
cd  sphinx-0.9.8.1/
./configure --with-mysql-libs=/opt/local/lib/mysql5/mysql/
--with-mysql-includes=/opt/local/include/mysql5/mysql/
make
sudo make install

Much thanks to this post b/c I spent forever trying to get the bundled version of MySQL linked properly:

http://www.fozworks.com/2008/9/5/rake-installation-of-sphinx-in-mac-osx