in the city
Latest Blog Activity From The Decider
mysql gem and Leopard not playing nicely
Just installed the latest mysql for os x Leopard. Re-installed the mysql gem using:
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
All seemed to go well but when trying to
rake test I got:
dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found
The gem is looking in the wrong place for the dylib!
sudo mkdir /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/lib/libmysqlclient.15.dylib /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Keynote kills .svn
Gee thanks keynote. Just when I was beginning to like your great abilities you go and rewrite your entire bundle (read directory) on every save thus blowing away the .svn directory. I can’t think of anyway around this since subversion requires .svn dirs at each level of hierarchy. I suppose now is the time to switch to git or bazaar
Site wide search using mysql
I’m working on a site wide search using only mysql and not ferret or sphinx. I’m not ready to lift the veil but the big picture is:
- There is a search model and table where with a full text index
- Each model wishing to participate in searching responds to a callback function to create an index in the search table.
- Each model has a view that displays their results.
Anyone interested? So far the speed is very impressive and you don’t need to launch any additional daemons like sphinx and ferret require.
Back to work.
less is more
Use less to view your logs.
What? it looks ugly? with weird escape characters and such…?
less -r log/development.log
Why? Well if you have a large log file then it could take a while to load it into an editor and ‘less’ is smarter than that… Search using normal vi commands: / and ?
Move around in the file using SPACE, j,k,l,; or the arrow keys. g gets you to the top of the file and G gets you to the bottom.
h is help and as always RTFM, man less
Migrate your production environment
I always have to think a bit about this but it’s really quite simple in unix os. On the command line try:
RAILS_ENV='production' rake db:migrate