Archive for October, 2011

Resynching the clock on a guest Ubuntu VM

October 19th, 2011

Thanks to MKo who answered this question:

http://stackoverflow.com/questions/5098333/vmware-time-sync-problem-ubuntu-guest-on-windows-7-host

If you find that your Ubuntu clock continues to drift, despite having installed the vmwave-tools, here’s a command to fix it.

sudo ntpdate ntp.ubuntu.com

Why rip this off?  Because I remember the URL of my own blog a lot better than 5098333.

Big gotcha with Carrierwave and custom versions/processors

October 17th, 2011

Short version: Make bloody sure your versions don’t have the same name as your methods you call with process:

Long version:

I forget the exact sequence that brought me to this problem, but I was doing baby steps through setting up some custom versions and processes with Carrierwave.  I had set up the following (roughly):

class PreviewUploader < CarrierWave::Uploader::Base

version :detail_bob do

process :detail_bob => ‘bob’
end
end

I had an included file in lib that defined “detail_bob.”  I was getting the error:

ArgumentError: wrong number of arguments (1 for 0)

The best part was that I’d get THAT error even if I removed the include for my library file that defined detail_bob!  I would have expected something more along the lines of “undefined method,” or something like that.

Anyway, it turned out that giving the version and the process call the same name was causing the problem.  I suspect that the process call was invoking method “detail_bob” that was defined by the version call.  Since the lib file was included before the call to version (naturally), the version overrode the lib file version.

Hopefully this can save you some grief.