Latest Blog Activity From The Decider

The Decider said over 5 years ago permalink Comment? (0)
Tagged: os x gem mysql leopard

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 Trace/BPT trap

Crap!

The gem is looking in the wrong place for the dylib!

Fix

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

The Decider said over 5 years ago permalink Comment? (0)
Tagged: keynote svn subversion

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

The Decider said over 5 years ago permalink Comment? (0)
Tagged: search sphinx ferret

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.

The Decider said over 5 years ago permalink Comment? (0)
Tagged: log rails less

less is more

Use less to view your logs.


 less log/development.log

What? it looks ugly? with weird escape characters and such…?

Try this:


 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

The Decider said over 5 years ago permalink Comment? (0)
Tagged: migration production

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