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
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!!!
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.
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